]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-139373: Fix asyncio Process.communicate() losing output when cancelled (#154223)
authorKumar Aditya <kumaraditya@python.org>
Tue, 21 Jul 2026 08:53:58 +0000 (14:23 +0530)
committerGitHub <noreply@github.com>
Tue, 21 Jul 2026 08:53:58 +0000 (14:23 +0530)
commit027a8336891cf7dab6a437a5d4f9213a6a7828cd
tree2fa3318462af6937793f9901cf020a862a514b94
parentdaf09e17bf99c544e8ab7a72b11f10f2e382a381
gh-139373: Fix asyncio Process.communicate() losing output when cancelled (#154223)

Output already read when communicate() is cancelled (e.g. by a
wait_for() timeout) is now retained on the Process and returned by a
subsequent communicate() call, matching subprocess.Popen.communicate()
behaviour on timeout. Passing input to a communicate() call following a
cancelled one now raises ValueError.
Doc/library/asyncio-subprocess.rst
Lib/asyncio/subprocess.py
Lib/test/test_asyncio/test_subprocess.py
Misc/NEWS.d/next/Library/2026-07-20-12-45-00.gh-issue-139373.qL7xKm.rst [new file with mode: 0644]