]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141473: Document not calling Popen.wait after Popen.communicate times out...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 1 Dec 2025 02:56:30 +0000 (03:56 +0100)
committerGitHub <noreply@github.com>
Mon, 1 Dec 2025 02:56:30 +0000 (02:56 +0000)
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 3e2c55749326809a2fc76b9f2cb87a6f89037ebe)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Doc/library/subprocess.rst

index 45dfd9ed025813709cc4f0c48e5f0dd374f9bd95..f6d9a6133fa8c0c45edfb47d26bd538f29c786c8 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