Gregory P. Smith
6e73000723
Add a subprocess.run() function than returns a CalledProcess instance for a
more consistent API than the existing call* functions.
(enhancement from issue 23342)
11 years ago
Gregory P. Smith
cb6fdf2c63
issue10838: Rename the subprocess.mswindows internal global to _mswindows.
It is internal only, not a documented API.
11 years ago
Gregory P. Smith
ace55865c5
Addresses Issue #10838 : The subprocess now module includes
SubprocessError and TimeoutError in its list of exported names for the
users wild enough to use "from subprocess import *".
MAXFD, mswindows and list2cmdline should be dealt with (renamed or
moved) in separate commits.
Committed at 35,000ft. Thanks chromebook free gogo wifi passes!
11 years ago
Serhiy Storchaka
ab900c21fc
Issue #21619 : Popen objects no longer leave a zombie after exit in the with
statement if the pipe was broken. Patch by Martin Panter.
11 years ago
Charles-François Natali
6e6c59b508
Issue #23285 : PEP 475 -- Retry system calls failing with EINTR.
11 years ago
Victor Stinner
a5e881d2e8
Closes #23234 : Refactor subprocess
Use new OSError exceptions, factorize stdin.write() code.
11 years ago
Antoine Pitrou
afe8d0646c
Issue #21332 : Ensure that ``bufsize=1`` in subprocess.Popen() selects line buffering, rather than block buffering.
11 years ago
Victor Stinner
ae58649721
Issue #22043 : time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
12 years ago
Serhiy Storchaka
465e60e654
Issue #22033 : Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
12 years ago
Gregory P. Smith
7be74cffbe
Remove the obsolete MAXFD constant and Popen._close_fds() method.
They should have been removed years ago when removing the old pure
Python implementation from the file.
12 years ago
Gregory P. Smith
d65ba51e24
subprocess's Popen.wait() is now thread safe so that multiple threads
may be calling wait() or poll() on a Popen instance at the same time
without losing the Popen.returncode value. Fixes issue #21291 .
12 years ago
Andrew Kuchling
4f7b0c3c35
#10481 : describe universal_newlines' effect on communicate()/check_output() output (alternately bytes or strings)
Patch by Sam Kimbrel.
12 years ago
Victor Stinner
7fa767e517
Issue #20976 : pyflakes: Remove unused imports
12 years ago
Benjamin Peterson
21317b654e
merge 3.3 ( #19060 )
12 years ago
Benjamin Peterson
5eea8a7780
remove unnecessary word ( closes #19060 )
Patch by Anastasia Filatova.
12 years ago
Victor Stinner
d5c8ce7cc0
Issue #19612 : On Windows, subprocess.Popen.communicate() now ignores
OSError(22, 'Invalid argument') when writing input data into stdin, whereas
the process already exited.
12 years ago
Serhiy Storchaka
72e7761301
issue12085: Use more Pythonic way to check _child_created.
_active shouldn't be cached, it set to None on shutdown.
12 years ago
Gregory P. Smith
589ecda56e
Fixes issue #19929 : Call os.read with 32768 within subprocess.Popen
communicate rather than 4096 for efficiency. A microbenchmark shows
Linux and OS X both using ~50% less cpu time this way.
12 years ago
Gregory P. Smith
774f909489
Fixes issue #19506 : Use a memoryview to avoid a data copy when piping data
to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
12 years ago
Gregory P. Smith
53dd8167ff
Fixes issue #15798 : subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed. (correct fix for 3.4 this time)
12 years ago
Gregory P. Smith
361e30c17a
Undo supposed fix for Issue #15798 until I understand why this is
causing test_multiprocessing_forkserver and test_multiprocessing_spawn
failures on head (3.4).
12 years ago
Gregory P. Smith
1eda9e7c30
Fixes Issue #15798 - subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
12 years ago
Tim Golden
acea823fd8
Remove outdated comment
12 years ago
Charles-François Natali
3a4586a9f9
Issue #18923 : Update subprocess to use the new selectors module.
12 years ago
Tim Golden
607981402c
Issue #10197 Tweak docs for subprocess.getstatusoutput and align the documentation, the module docstring, and the function docstring.
12 years ago
Tim Golden
e004175c56
Issue #10197 Rework subprocess.get[status]output to use subprocess functionality and thus to work on Windows. Patch by Nick Coghlan.
12 years ago
Nick Coghlan
ac1a248968
Close #19284 : Handle -R properly in flag helper
Previously, the -R option would be specified multiple times
if PYTHONHASHSEED was set.
12 years ago
Victor Stinner
daf455554b
Issue #18571 : Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
13 years ago
Ezio Melotti
30b9d5d3af
#18705 : fix a number of typos. Patch by Févry Thibault.
13 years ago
Ronald Oussoren
385521c90e
Cleanup of documentation change from #17860
Reformulated the textual change, and applied it to the docstring as well.
13 years ago
Brett Cannon
cd171c8e92
Issue #18200 : Back out usage of ModuleNotFoundError (8d28d44f3a9a)
13 years ago
Gregory P. Smith
b5461b9884
Prevent a possible double close of parent pipe fds when the subprocess
exec runs into an error. Prevent a regular multi-close of the /dev/null
fd when any of stdin, stdout and stderr was set to DEVNULL.
13 years ago
Brett Cannon
0a140668fa
Issue #18200 : Update the stdlib (except tests) to use
ModuleNotFoundError.
13 years ago
Serhiy Storchaka
fcd9f22238
Issue #16624 : `subprocess.check_output` now accepts an `input` argument,
allowing the subprocess's stdin to be provided as a (byte) string.
Patch by Zack Weinberg.
13 years ago
Gregory P. Smith
a1ed539268
Fixes issue #17488 : Change the subprocess.Popen bufsize parameter default value
from unbuffered (0) to buffering (-1) to match the behavior existing code
expects and match the behavior of the subprocess module in Python 2 to avoid
introducing hard to track down bugs.
13 years ago
Gregory P. Smith
1f8a40b81d
remove the long obsolete mention of universal newlines mode only being
available when configured at compile time.
13 years ago
Gregory P. Smith
91110f5e55
Use a larger amount of data for tests such as the interrupted_write
tests that depend on filling up an OS pipe so that they work properly
on systems configured with large pipe buffers.
13 years ago
Kristján Valur Jónsson
8927e8f421
Issue #12098 : multiprocessing on Windows now starts child processes
using the same sys.flags as the current process.
Backport from default branch.
13 years ago
Serhiy Storchaka
b3f194d109
Issue #16903 : Popen.communicate() on Unix now accepts strings when
universal_newlines is true as on Windows.
13 years ago
Andrew Svetlov
f7a17b48d7
Replace IOError with OSError ( #16715 )
13 years ago
Andrew Svetlov
332562f447
Keep ref to ECHILD in local scope ( #16650 )
13 years ago
Andrew Svetlov
08bab07291
Keep ref to ECHILD in local scope ( #16650 )
13 years ago
Brian Curtin
445ad997ab
Fix #14470 . Remove w9xpopen per PEP 11.
As stated in PEP 11, 3.4 removes code on Windows platforms where
COMSPEC points to command.com. The w9xpopen project in Visual Studio
was added to support that case, and there was a special case in subprocess
to cover that situation. This change removes the w9xpopen project from
the Visual Studio solution and removes any references to the w9xpopen
executable.
13 years ago
Andrew Svetlov
ad28c7f9da
Issue #16706 : get rid of os.error
13 years ago
Andrew Svetlov
3438fa496d
Get rig of EnvironmentError ( #16705 )
13 years ago
Andrew Svetlov
6d8a122b9c
Issue #16704 : Get rid of select.error in stdlib. Use OSError instead.
13 years ago
Andrew Svetlov
df485ca493
Remove obsolete code: now IOError and WindowsError are aliases for OSError
13 years ago
Gregory P. Smith
211248b214
Fix issue #16140 bug that the fix to issue #16327 added - don't double
close subprocess.PIPE file descriptors when the child encounters an
error prior to exec.
13 years ago
Gregory P. Smith
12489d98e6
Fixes issue #16140 : The subprocess module no longer double closes its
child subprocess.PIPE parent file descriptors on child error prior to
exec().
This would lead to race conditions in multithreaded programs where
another thread opened a file reusing the fd which was then closed out
from beneath it by the errant second close.
13 years ago
Gregory P. Smith
3aee222122
Remove the subprocess "bad exception data" warning (formerly a print!)
all together and just include the repr of the data in the exception
itself instead of the useless string "Unknown".
This code path is unlikely to even be possible to take given the
nature of the pipe it gets subprocess data from.
13 years ago