Skip to content

Commit 6871aa1

Browse files
[3.13] gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101) (#142125)
gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101) Document not calling Popen.wait after Popen.communicate times out. Closes GH-141473 (cherry picked from commit 3e2c557) Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
1 parent 42c6e75 commit 6871aa1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/subprocess.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,11 @@ Instances of the :class:`Popen` class have the following methods:
846846
proc.kill()
847847
outs, errs = proc.communicate()
848848

849+
After a call to :meth:`~Popen.communicate` raises :exc:`TimeoutExpired`, do
850+
not call :meth:`~Popen.wait`. Use an additional :meth:`~Popen.communicate`
851+
call to finish handling pipes and populate the :attr:`~Popen.returncode`
852+
attribute.
853+
849854
.. note::
850855

851856
The data read is buffered in memory, so do not use this method if the data

0 commit comments

Comments
 (0)