mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
ed154c387e
commit
e85a305503
4 changed files with 57 additions and 3 deletions
|
@ -774,6 +774,8 @@ Instances of the :class:`Popen` class have the following methods:
|
|||
|
||||
Sends the signal *signal* to the child.
|
||||
|
||||
Do nothing if the process completed.
|
||||
|
||||
.. note::
|
||||
|
||||
On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue