summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-02-25 16:41:19 (GMT)
committerGitHub <noreply@github.com>2022-02-25 16:41:19 (GMT)
commitdd69f734218ac5d3a551227069ac53ee09b0cd3e (patch)
tree598bea7a094da7f1a5abbe07161acbbc0e8a2473 /Doc
parent87af12bff33b3e7546fa26158b7d8680ecb6ecec (diff)
downloadcpython-dd69f734218ac5d3a551227069ac53ee09b0cd3e.zip
cpython-dd69f734218ac5d3a551227069ac53ee09b0cd3e.tar.gz
cpython-dd69f734218ac5d3a551227069ac53ee09b0cd3e.tar.bz2
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/subprocess.rst30
1 files changed, 16 insertions, 14 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 21a96a4..ab9f1d8 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -264,13 +264,14 @@ default values. The arguments that are most commonly needed are:
*stdin*, *stdout* and *stderr* specify the executed program's standard input,
standard output and standard error file handles, respectively. Valid values
are :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a positive
- integer), an existing file object, and ``None``. :data:`PIPE` indicates
- that a new pipe to the child should be created. :data:`DEVNULL` indicates
- that the special file :data:`os.devnull` will be used. With the default
- settings of ``None``, no redirection will occur; the child's file handles
- will be inherited from the parent. Additionally, *stderr* can be
- :data:`STDOUT`, which indicates that the stderr data from the child
- process should be captured into the same file handle as for *stdout*.
+ integer), an existing file object with a valid file descriptor, and ``None``.
+ :data:`PIPE` indicates that a new pipe to the child should be created.
+ :data:`DEVNULL` indicates that the special file :data:`os.devnull` will
+ be used. With the default settings of ``None``, no redirection will occur;
+ the child's file handles will be inherited from the parent.
+ Additionally, *stderr* can be :data:`STDOUT`, which indicates that the
+ stderr data from the child process should be captured into the same file
+ handle as for *stdout*.
.. index::
single: universal newlines; subprocess module
@@ -482,13 +483,14 @@ functions.
*stdin*, *stdout* and *stderr* specify the executed program's standard input,
standard output and standard error file handles, respectively. Valid values
are :data:`PIPE`, :data:`DEVNULL`, an existing file descriptor (a positive
- integer), an existing :term:`file object`, and ``None``. :data:`PIPE`
- indicates that a new pipe to the child should be created. :data:`DEVNULL`
- indicates that the special file :data:`os.devnull` will be used. With the
- default settings of ``None``, no redirection will occur; the child's file
- handles will be inherited from the parent. Additionally, *stderr* can be
- :data:`STDOUT`, which indicates that the stderr data from the applications
- should be captured into the same file handle as for stdout.
+ integer), an existing :term:`file object` with a valid file descriptor,
+ and ``None``. :data:`PIPE` indicates that a new pipe to the child should
+ be created. :data:`DEVNULL` indicates that the special file
+ :data:`os.devnull` will be used. With the default settings of ``None``,
+ no redirection will occur; the child's file handles will be inherited from
+ the parent. Additionally, *stderr* can be :data:`STDOUT`, which indicates
+ that the stderr data from the applications should be captured into the same
+ file handle as for stdout.
If *preexec_fn* is set to a callable object, this object will be called in the
child process just before the child is executed.