summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-27448: Work around a gc.disable race condition in subprocess. (#1932)Gregory P. Smith2017-09-051-7/+29
| | | | | | | | | | | | | | | | | * bpo-27448: Work around a gc.disable race condition in subprocess. This works around a gc.isenabled/gc.disable race condition in the 2.7 subprocess module by using a lock for the critical section. It'll prevent multiple simultaneous subprocess launches from winding up with gc remaining disabled but it can't fix the ultimate problem: gc enable and disable is a global setting and a hack. Users are *strongly encouraged* to use subprocess32 from PyPI instead of the 2.7 standard library subprocess module. Mixing threads with subprocess is a recipie for disaster otherwise even with "fixes" to ameliorate common issues like this. * Add a blurb!
* bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)Victor Stinner2017-06-081-4/+5
| | | | | | On Windows, subprocess.Popen.communicate() now also ignore EINVAL on stdin.write() if the child process is still running but closed the pipe. (cherry picked from commit d52aa31378ae43e044a300edfe8285954c167216)
* Issue #29335: Fix subprocess.Popen.wait() when the child process hasGregory P. Smith2017-01-231-1/+4
| | | | exited to a stopped instead of terminated state (ex: when under ptrace).
* Issue #28998: More APIs now support longs as well as ints.Serhiy Storchaka2016-12-271-6/+6
|
* Issue #26240: Clean up the subprocess module doc stringMartin Panter2016-10-261-377/+58
| | | | Patch by Tim Mitchell.
* issue26083: Avoid duplicate error message string from a subprocess exec ↵Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-05-281-1/+1
| | | | | | failure.Avoid a duplicate error message string from a subprocess exec failure. :P
* Issue #22274: Redirect stderr=STDOUT when stdout not redirected, by Akira LiMartin Panter2016-05-131-1/+4
|
* Fixes issue #26083: Workaround a subprocess bug that raised an incorrectGregory P. Smith2016-01-111-1/+5
| | | | | | | "ValueError: insecure string pickle" exception instead of the actual exception on some platforms such as Mac OS X when an exception raised in the forked child process prior to the exec() was large enough that it overflowed the internal errpipe_read pipe buffer.
* Fixes issue #20954: _args_from_interpreter_flags used by multiprocessingGregory P. Smith2015-12-131-1/+2
| | | | | and some tests no longer behaves incorrectly in the presence of the PYTHONHASHSEED environment variable.
* Issue #19612: subprocess.communicate() now also ignores EINVAL when using atVictor Stinner2014-07-281-1/+9
| | | | least two pipes.
* remove unnecessary word (closes #19060)Benjamin Peterson2014-03-131-1/+1
| | | | Patch by Anastasia Filatova.
* issue12085: Use more Pythonic way to check _child_created.Serhiy Storchaka2014-02-101-4/+5
| | | | _active shouldn't be cached, it set to None on shutdown.
* Issue #18851: Avoid a double close of subprocess pipes when the child ↵Antoine Pitrou2013-08-301-27/+46
| | | | process fails starting.
* Issue #18763: subprocess: The file descriptors are now closed after calling theCharles-François Natali2013-08-251-4/+5
| | | | preexec_fn callback, which may open file descriptors.
* #18705: fix a number of typos. Patch by Févry Thibault.Ezio Melotti2013-08-171-1/+1
|
* Issue #18186: remove obsolete 2.2 compatibility comment.Ned Deily2013-06-111-2/+0
|
* Issue #12098: multiprocessing on Windows now starts child processesKristján Valur Jónsson2013-03-191-0/+31
| | | | | using the same sys.flags as the current process. Backport from default branch.
* Keep ref to ECHILD in local scope (#16650)Andrew Svetlov2012-12-241-2/+2
|
* Fix issue #16140 bug that the fix to issue #16327 added - don't doubleGregory P. Smith2012-11-111-3/+0
| | | | | close subprocess.PIPE file descriptors when the child encounters an error prior to exec.
* Fixes issue #16327: The subprocess module no longer leaks file descriptorsGregory P. Smith2012-11-111-6/+27
| | | | used for stdin/stdout/stderr pipes to the child when fork() fails.
* Fixes issue #14396: Handle the odd rare case of waitpid returning 0Gregory P. Smith2012-11-111-2/+6
| | | | when not expected in subprocess.Popen.wait().
* Issue #15756: subprocess.poll() now properly handles errno.ECHILD toGregory P. Smith2012-09-291-1/+8
| | | | | return a returncode of 0 when the child has already exited or cannot be waited on.
* Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under ↵Antoine Pitrou2012-03-111-1/+11
| | | | Windows when the child process has already exited.
* Issue #12786: Set communication pipes used by subprocess.Popen CLOEXEC to avoidCharles-François Natali2011-08-251-6/+16
| | | | them being inherited by other subprocesses.
* Issue #12650: Fix a race condition where a subprocess.Popen could leakCharles-François Natali2011-08-181-1/+1
| | | | resources (FD/zombie) when killed at the wrong time.
* Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr isRoss Lagerwall2011-07-271-0/+8
| | | | given as a low fd, it gets overwritten.
* Issue #12493: subprocess: communicate() handles EINTRVictor Stinner2011-07-051-3/+3
| | | | | subprocess.Popen.communicate() now also handles EINTR errors if the process has only one pipe.
* Close #12085: Fix an attribute error in subprocess.Popen destructor if theVictor Stinner2011-05-311-1/+4
| | | | | constructor has failed, e.g. because of an undeclared keyword argument. Patch written by Oleg Oshmyan.
* whitespace fixBrian Curtin2011-04-291-1/+1
|
* mergeBrian Curtin2011-04-291-2/+9
|
* Issue #10963: Ensure that subprocess.communicate() never raises EPIPE.Ross Lagerwall2011-04-051-11/+34
|
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
|
* Merged revisions 87695 via svnmerge fromAntoine Pitrou2011-01-031-17/+24
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87695 | antoine.pitrou | 2011-01-03 19:23:55 +0100 (lun., 03 janv. 2011) | 5 lines Issue #10806, issue #9905: Fix subprocess pipes when some of the standard file descriptors (0, 1, 2) are closed in the parent process. Initial patch by Ross Lagerwall. ........
* Merged revisions 87233 via svnmerge fromGregory P. Smith2010-12-141-2/+14
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87233 | gregory.p.smith | 2010-12-14 06:38:00 -0800 (Tue, 14 Dec 2010) | 4 lines Issue #1731717: Fixed the problem where subprocess.wait() could cause an OSError exception when The OS had been told to ignore SIGCLD in our process or otherwise not wait for exiting child processes. ........
* Merged revisions 84582 via svnmerge fromBrian Curtin2010-09-071-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84582 | brian.curtin | 2010-09-07 08:24:38 -0500 (Tue, 07 Sep 2010) | 3 lines Adjust #8956 to add the bad signal number to the exception message. ........
* Merged revisions 84559 via svnmerge fromBrian Curtin2010-09-061-1/+1
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84559 | brian.curtin | 2010-09-06 11:29:29 -0500 (Mon, 06 Sep 2010) | 6 lines Fix #8956. ValueError message was only mentioning one signal. Rather than list out the three signals (or more over time), the message was made less specific but still descriptive. ........
* #2304: fix incorporating Eric Smith's .format suggestion and tested on ↵Tim Golden2010-08-121-2/+2
| | | | Ubuntu as well as Windows
* revert 83832; unix test breakageBenjamin Peterson2010-08-081-1/+1
|
* Issue #2304: Add additional quotes when using cmd shell on Windows. Original ↵Tim Golden2010-08-081-1/+1
| | | | patch from Gabriel Genellina
* Issue #3210: Revert C module changes and apply patch from Hirokazu Yamamoto ↵Tim Golden2010-08-081-14/+13
| | | | instead
* Issue #9265: Incorrect name passed as arg[0] when shell=TrueStefan Krah2010-07-191-0/+2
| | | | and executable specified.
* Revert r60115Jean-Paul Calderone2010-06-181-3/+3
| | | | | | | | | | | | This revision introduced quoting for strings containing | based on a misunderstanding of the commonly used quoting rules used on Windows. | is interpreted by cmd.exe, not by the MS C runtime argv initializer. It only needs to be quoted if it is part of an argument passed through cmd.exe. See issue1300, issue7839, and issue8972.
* Fix regression introduced by r81154 (Issue #5099, subprocess destructor)Victor Stinner2010-05-141-3/+3
|
* subprocess.Popen.__del__ referenced global objects, which is a no-no thanks toBrett Cannon2010-05-141-17/+34
| | | | | | | | | | | | | | | | interpreter shutdown semantics. Same issue goes for the methods that __del__ called. Now all the methods capture the global objects it needs as default values to private parameters (could have stuck them on the class object itself, but since the objects have nothing directly to do with the class that seemed wrong). There is no test as making one that works is hard. This patch was verified against a consistently failing test in Mercurial's test suite, though, so it has been tested in some regard. Closes issue #5099. Thanks to Mary Stern for the bug report and Gabriel Genellina for writing another patch for the same issue and attempting to write a test.
* Revert an accidental commit from r80492.Brett Cannon2010-04-251-36/+17
|
* When DeprecationWarning was silenced by default, it also silenced any use of -QBrett Cannon2010-04-251-17/+36
| | | | | | | by default as well. This change fixes that by treating -Q like -3 when it comes to DeprecationWarning; using it causes the silencing to not occur. Fixes issue #7319.
* Fix #7838. Add docstrings and privatize _subprocess implementation details.Brian Curtin2010-04-241-47/+39
| | | | | | Since CREATE_NEW_* are used for the creation flags of a subprocess, they were added to __all__. The rest of the previously exposed attributes are now qualified by _subprocess.ATTR rather than importing *.
* Implement #1220212. Add os.kill support for Windows.Brian Curtin2010-04-021-0/+4
| | | | | | | | | | | | | | os.kill takes one of two newly added signals, CTRL_C_EVENT and CTRL_BREAK_EVENT, or any integer value. The events are a special case which work with subprocess console applications which implement a special console control handler. Any other value but those two will cause os.kill to use TerminateProcess, outright killing the process. This change adds win_console_handler.py, which is a script to implement SetConsoleCtrlHandler and applicable handler function, using ctypes. subprocess also gets another attribute which is a necessary flag to creationflags in Popen in order to send the CTRL events.
* Fix syntax: "rc != None" -> "rc is not None"Florent Xicluna2010-03-081-1/+1
|
* Issue #1068268: The subprocess module now handles EINTR in internalGregory P. Smith2010-03-011-3/+14
| | | | os.waitpid and os.read system calls where appropriate.