]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH...
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Mon, 1 Dec 2025 02:50:05 +0000 (18:50 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Dec 2025 02:50:05 +0000 (18:50 -0800)
Document not calling Popen.wait after Popen.communicate times out.

Closes #141473

Doc/library/subprocess.rst

index 43da804b62beb15aa41aba43ee964a3ac099e007..b8dfcc310771fe0b7ebcf31300e4b20022b1cc72 100644 (file)
@@ -846,6 +846,11 @@ Instances of the :class:`Popen` class have the following methods:
           proc.kill()
           outs, errs = proc.communicate()
 
+   After a call to :meth:`~Popen.communicate` raises :exc:`TimeoutExpired`, do
+   not call :meth:`~Popen.wait`. Use an additional :meth:`~Popen.communicate`
+   call to finish handling pipes and populate the :attr:`~Popen.returncode`
+   attribute.
+
    .. note::
 
       The data read is buffered in memory, so do not use this method if the data