summaryrefslogtreecommitdiffstats
path: root/Doc/library/subprocess.rst
Commit message (Collapse)AuthorAgeFilesLines
* bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467)Gregory P. Smith2020-12-251-2/+3
| | | | | | | | | | When the modern text= spelling of the universal_newlines= parameter was added for Python 3.7, check_output's special case around input=None was overlooked. So it behaved differently with universal_newlines=True vs text=True. This reconciles the behavior to be consistent and adds a test to guarantee it. Also clarifies the existing check_output documentation. Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* [doc] Fix erroneous backslashes in signatures and names (GH-23658)Andre Delfino2020-12-171-1/+1
| | | | | The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch). The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.
* Add two spaces around equal sign (#23719)sblondon2020-12-131-1/+1
| | | Fit to PEP8 coding style
* bpo-40932: Note security caveat of shlex.quote on Windows (GH-21502)Ammar Askar2020-11-111-5/+2
| | | | | Added a note in the `subprocess` docs that recommend using `shlex.quote` without mentioning that this is only applicable to Unix. Also added a warning straight into the `shlex` docs since it only says "for simple syntaxes resembling that of the Unix shell" and says using `quote` plugs the security hole without mentioning this important caveat.
* bpo-42041: Clarify how subprocess searches for the executable (GH-22715)Paul Moore2020-10-201-2/+21
| | | Clarify in the subprocess documentation how searching for the executable to run works, noting that ``sys.executable`` is the recommended way to find the current interpreter.
* bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and ↵Ruben Vorderman2020-10-191-1/+9
| | | | | | | | | | | | | | | | | F_SETPIPE_SZ to fcntl. (GH-21921) * Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module * Add pipesize parameter for subprocess.Popen class This will allow the user to control the size of the pipes. On linux the default is 64K. When a pipe is full it blocks for writing. When a pipe is empty it blocks for reading. On processes that are very fast this can lead to a lot of wasted CPU cycles. On a typical Linux system the max pipe size is 1024K which is much better. For high performance-oriented libraries such as xopen it is nice to be able to set the pipe size. The workaround without this feature is to use my_popen_process.stdout.fileno() in conjuction with fcntl and 1031 (value of F_SETPIPE_SZ) to acquire this behavior.
* bpo-40707: Document that Popen.communicate sets the returncode attribute ↵Gareth Rees2020-06-241-4/+5
| | | | (GH-20283)
* Doc: change 'Posix' for 'POSIX' (GH-20001)Mathieu Dupuy2020-05-171-2/+2
|
* bpo-39976: Add **other_popen_kwargs to subprocess docs (GH-20145)Zackery Spytz2020-05-171-4/+8
| | | | Patch by Zackery Spytz.
* bpo-13826: Clarify Popen constructor example (GH-18438)Tim D. Smith2020-02-101-2/+8
| | | | | | | | | | Clarifies that the use of `shlex.split` is more instructive than normative, and provides a simpler example. https://bugs.python.org/issue13826
* bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)Victor Stinner2020-01-151-0/+2
| | | | | | | On Unix, subprocess.Popen.send_signal() now polls the process status. Polling reduces the risk of sending a signal to the wrong process if the process completed, the Popen.returncode attribute is still None, and the pid has been reassigned (recycled) to a new different process.
* Added missing coma after end of list in subprocess.rst (GH-17217)Jules Lasne (jlasne)2019-11-191-1/+1
| | | Automerge-Triggered-By: @csabella
* bpo-38417: Add umask support to subprocess (GH-16726)Gregory P. Smith2019-10-121-3/+9
| | | | On POSIX systems, allow the umask to be set in the child process before we exec.
* bpo-36046: Add user and group parameters to subprocess (GH-11950)Patrick McLean2019-09-121-2/+30
| | | | | | | | | | | | | | * subprocess: Add user, group and extra_groups paremeters to subprocess.Popen This adds a `user` parameter to the Popen constructor that will call setreuid() in the child before calling exec(). This allows processes running as root to safely drop privileges before running the subprocess without having to use a preexec_fn. This also adds a `group` parameter that will call setregid() in the child process before calling exec(). Finally an `extra_groups` parameter was added that will call setgroups() to set the supplimental groups.
* Minor ReST formatting fixes in subprocess docs (#14876)Tim Hoffmann2019-09-111-4/+4
|
* bpo-37951: Lift subprocess's fork() restriction (GH-15544)Christian Heimes2019-08-271-0/+7
|
* Replace backquote with command substitution in subprocess doc example (GH-13941)David Jones2019-07-161-5/+5
| | | Replace backquotes with POSIXy command substitution in example.
* bpo-37390: Add audit event table to documentations (GH-14406)Steve Dower2019-06-271-1/+1
| | | Also updates some (unreleased) event names to be consistent with the others.
* bpo-37363: Add audit events for a range of modules (GH-14301)Steve Dower2019-06-241-0/+7
|
* bpo-31961: Fix support of path-like executables in subprocess. (GH-5914)Serhiy Storchaka2019-05-281-3/+26
|
* bpo-36760: Clarify subprocess capture_output docs. (GH-13322)Gregory P. Smith2019-05-141-1/+3
| | | Clarify how to capture stdout and stderr combined into one stream.
* bpo-35537: Document posix_spawn() change in subprocess (GH-11668)Victor Stinner2019-04-251-0/+7
| | | | | Document that subprocess.Popen no longer raise an exception on error like missing program on very specific platforms when using os.posix_spawn() is used.
* bpo-33319: Clarify subprocess call docs. (GH-12508)Gregory P. Smith2019-03-231-12/+13
| | | | | Clarify capturing or suppressing stdout and stderr on the old call APIs. Do not state that they are equivalent to run() calls when they are not implemented using run as that was misleading. Unlike run they cannot handle stdout or stderr being set to PIPE without a risk of deadlock.
* Fixed a missing . and a missing capital letter. (GH-12170)Jules Lasne (jlasne)2019-03-041-2/+2
|
* bpo-31450: Remove documentation mentioning that subprocess's child_traceback ↵Harmandeep Singh2019-01-031-3/+1
| | | | is available with the parent process (GH-11422)
* Update subprocess.Popen documentation wrt universal_newlines arg (GH-10337)Jakub Stasiak2018-11-121-3/+8
| | | | | | | | * universal_newlines defaulting to False would suggest, that not specifying universal_newlines explicitly and setting text to True should cause an error, which is not the case. * The run function didn't have the universal_newlines parameter documented * The check_output function didn't have its text parameter documented
* bpo-11233: Create availability directive for documentation (GH-9692)Cheryl Sabella2018-10-121-2/+2
| | | | | | Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org>
* Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477)Xiang Zhang2018-09-211-2/+3
| | | Make it more accurate and not limited to UNIX.
* Doc: add missing capture_output arg to subprocess.run() signature (#8374)Andriy Maletsky2018-08-091-2/+2
|
* versionadded -> versionchanged for all 'X parameter was added' for ↵Sergey Fedoseev2018-07-061-1/+1
| | | | | | uniformity. (GH8114) Per the recommendation in our Developer's Guide: https://devguide.python.org/documenting/#paragraph-level-markup
* bpo-32392: Document env keyword argument of subprocess.run() (GH-7289)Tobias Kunze2018-06-051-1/+6
|
* Clarify fd inheritance when close_fds=False. (GH-6240)Gregory P. Smith2018-03-251-1/+4
| | | Clarify the subprocess documentation.
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" (#5912)Serhiy Storchaka2018-02-271-10/+6
| | | | | | * Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" This reverts commit dd42cb71f2cb02f3a32f016137b12a146bc0d0e2.
* bpo-32815: Improve docs on the subprocess API *text* parameter (GH-5622)Pablo Galindo2018-02-111-8/+15
| | | Describe *text* as an alias for *universal_newlines* in more places that people are likely to be referred to.
* bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564)Brice Gros2018-02-071-0/+3
| | | Fixes the documentation for `subprocess.check_output()` not mentioning that the encoding and errors parameters were added in 3.6.
* bpo-31961: subprocess now accepts path-like args (GH-4329)Anders Lorentsen2018-01-301-6/+10
| | | Allow os.PathLike args in subprocess APIs.
* bpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)Bo Bayles2018-01-301-8/+11
| | | | Add "capture_output=True" option to subprocess.run, this is equivalent to setting stdout=PIPE, stderr=PIPE but is much more readable.
* bpo-19764: Implemented support for subprocess.Popen(close_fds=True) on ↵Segev Finer2017-12-181-6/+36
| | | | | | | | | | | | | | | | | Windows (#1218) Even though Python marks any handles it opens as non-inheritable there is still a race when using `subprocess.Popen` since creating a process with redirected stdio requires temporarily creating inheritable handles. By implementing support for `subprocess.Popen(close_fds=True)` we fix this race. In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST which is available since Windows Vista. Which allows to pass an explicit list of handles to inherit when creating a process. This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]` which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST directly.
* bpo-31884 subprocess: add Windows constants for process priority (#4150)James2017-11-081-4/+94
|
* bpo-31756: subprocess.run should alias universal_newlines to text (#4049)andyclegg2017-10-231-7/+12
| | | | | | | | | Improve human friendliness of the Popen API: Add text=False as a keyword-only argument to subprocess.Popen along with a Popen attribute .text_mode and set this based on the encoding/errors/universal_newlines/text arguments. The universal_newlines parameter and attribute are maintained for backwards compatibility.
* bpo-22635: subprocess.getstatusoutput doc update. (#3398)Gregory P. Smith2017-09-071-7/+12
| | | | | The `subprocess.getstatusoutput` API was inadvertently changed in Python 3.3.4. Document the change, it is too late to undo the API change now as it has shipped in many stable releases.
* bpo-31065: Add doc about Popen.poll returning None. (#3169)Ivan Chernoff2017-08-291-1/+1
|
* bpo-30420: List cwd parameter in subprocess convenience APIs (GH-1685)Alex Gaynor2017-05-261-4/+4
| | | | | | | | | | Partially clarify the subprocess convenience API documentation by explicitly listing the `cwd` parameter in their abbreviated signatures. While this has been merged as an improvement, it doesn't fully resolve the issue, as the `cwd` should also be covered in the "Frequently Used Arguments" section, and the fact these APIs pass unlisted keyword arguments down to the lower level APIs is currently still unclear.
* Tweak subprocess.STARTUPINFO documentation (#347)Berker Peksag2017-03-011-5/+7
| | | | * Document STARTUPINFO constructor * Move versionchanged directive to above of attributes
* bpo-28624: Add a test that checks that cwd parameter of Popen() accepts ↵Sayan Chowdhury2017-02-261-3/+7
| | | | PathLike objects (#157)
* bpo-26128: Added __init__to subprocess.STARTUPINFO (#171)Subhendu Ghosh2017-02-251-1/+4
| | | | | | | The Windows-specific subprocess.STARTUPINFO class now accepts keyword-only arguments to its constructor to set the various data attributes. Patch by Subhendu Ghosh.
* issue 20572: remove the deprecation notice for the deleted endtime parameter.Gregory P. Smith2016-11-211-6/+0
|
* Issue #19795: Improved more markups of True/False.Serhiy Storchaka2016-10-191-4/+4
|\
| * Issue #19795: Improved more markups of True/False.Serhiy Storchaka2016-10-191-1/+1
| |
* | Issue #19795: Mark up True and False as literal text instead of bold.Serhiy Storchaka2016-10-191-2/+2
|\ \ | |/