]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Jan 2020 16:38:55 +0000 (17:38 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Jan 2020 16:38:55 +0000 (17:38 +0100)
commite85a305503bf83c5a8ffb3a988dfe7b67461cbee
tree6bf49817955b9bba97c35a65bcaaa8c0e05ddb96
parented154c387efc5f978ec97900ec9e0ec6631d5498
bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)

On Unix, subprocess.Popen.send_signal() now polls the process status.
Polling reduces the risk of sending a signal to the wrong process if
the process completed, the Popen.returncode attribute is still None,
and the pid has been reassigned (recycled) to a new different
process.
Doc/library/subprocess.rst
Lib/subprocess.py
Lib/test/test_subprocess.py
Misc/NEWS.d/next/Library/2019-10-29-12-21-10.bpo-38630.Dv6Xrm.rst [new file with mode: 0644]