Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf2e515

Browse files
authored
bpo-40707: Document that Popen.communicate sets the returncode attribute (GH-20283)
1 parent cde283d commit bf2e515

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/library/subprocess.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,11 @@ Instances of the :class:`Popen` class have the following methods:
738738
.. method:: Popen.communicate(input=None, timeout=None)
739739

740740
Interact with process: Send data to stdin. Read data from stdout and stderr,
741-
until end-of-file is reached. Wait for process to terminate. The optional
742-
*input* argument should be data to be sent to the child process, or
743-
``None``, if no data should be sent to the child. If streams were opened in
744-
text mode, *input* must be a string. Otherwise, it must be bytes.
741+
until end-of-file is reached. Wait for process to terminate and set the
742+
:attr:`~Popen.returncode` attribute. The optional *input* argument should be
743+
data to be sent to the child process, or ``None``, if no data should be sent
744+
to the child. If streams were opened in text mode, *input* must be a string.
745+
Otherwise, it must be bytes.
745746

746747
:meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``.
747748
The data will be strings if streams were opened in text mode; otherwise,

0 commit comments

Comments
 (0)