bpo-38630: subprocess: enhance send_signal() on Unix by vstinner · Pull Request #16984 · python/cpython

@vstinner

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.

@vstinner vstinner deleted the subprocess_send_signal branch

January 15, 2020 16:38

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request

Jan 31, 2020
…H-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.