]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Sep 2019 10:05:58 +0000 (03:05 -0700)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2019 10:05:58 +0000 (03:05 -0700)
commit5fe153c21de020f37712910b0dcce93341bba272
tree5ea573d2524e76da78e4a9745f9f4ef8458d68e8
parent2a8560ae99213954158789b9dd7275b8ffa2086a
bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)

Fixes a possible hang when using a timeout on subprocess.run() while
capturing output. If the child process spawned its own children or otherwise
connected its stdout or stderr handles with another process, we could hang
after the timeout was reached and our child was killed when attempting to read
final output from the pipes.
(cherry picked from commit 580d2782f70f8e0bed7ec20abb03d740cb83b5da)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Lib/subprocess.py
Lib/test/test_subprocess.py
Misc/NEWS.d/next/Library/2019-07-04-13-00-20.bpo-37424.0i1MR-.rst [new file with mode: 0644]