summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-24 03:19:11 (GMT)
committerGitHub <noreply@github.com>2020-06-24 03:19:11 (GMT)
commit02d5c74f89709672baa866fcdd04278e59328351 (patch)
tree98268c24af676fd64df6882fc73b91b5b275ac1a /Doc
parent48fc35ada7c4237f11bb9638387bfe5b4cebfb12 (diff)
downloadcpython-02d5c74f89709672baa866fcdd04278e59328351.zip
cpython-02d5c74f89709672baa866fcdd04278e59328351.tar.gz
cpython-02d5c74f89709672baa866fcdd04278e59328351.tar.bz2
bpo-40707: Document that Popen.communicate sets the returncode attribute (GH-20283)
(cherry picked from commit bf2e515fa43406d4bd9c4c53ecc9364034d8f9f6) Co-authored-by: Gareth Rees <gdr@garethrees.org>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/subprocess.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 5988bd3..e37cc98 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -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,