[Python-checkins] bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
miss-islington
webhook-mailer at python.org
Fri Feb 25 12:07:17 EST 2022
https://github.com/python/cpython/commit/de2c91a89aa0e89d5d01d71697d0f27a9f60c11d
commit: de2c91a89aa0e89d5d01d71697d0f27a9f60c11d
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-02-25T09:07:05-08:00
summary:
bpo-26897: Clarify Popen stdin, stdout, stderr file object docs (GH-30231)
(cherry picked from commit dd69f734218ac5d3a551227069ac53ee09b0cd3e)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303 at users.noreply.github.com>
files:
M Doc/library/subprocess.rst
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 55dcc172bbc28..f9e9f63f2151e 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
@@ -463,13 +464,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.
More information about the Python-checkins
mailing list