bpo-40707: Document that Popen.communicate sets the returncode attribute (GH-20283)

(cherry picked from commit bf2e515fa4)

Co-authored-by: Gareth Rees <gdr@garethrees.org>
This commit is contained in:
Miss Islington (bot) 2020-06-23 20:19:11 -07:00 committed by GitHub
parent 48fc35ada7
commit 02d5c74f89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -738,10 +738,11 @@ Instances of the :class:`Popen` class have the following methods:
.. method:: Popen.communicate(input=None, timeout=None)
Interact with process: Send data to stdin. Read data from stdout and stderr,
until end-of-file is reached. Wait for process to terminate. The optional
*input* argument should be data to be sent to the child process, or
``None``, if no data should be sent to the child. If streams were opened in
text mode, *input* must be a string. Otherwise, it must be bytes.
until end-of-file is reached. Wait for process to terminate and set the
:attr:`~Popen.returncode` attribute. The optional *input* argument should be
data to be sent to the child process, or ``None``, if no data should be sent
to the child. If streams were opened in text mode, *input* must be a string.
Otherwise, it must be bytes.
:meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``.
The data will be strings if streams were opened in text mode; otherwise,