Bug description:
In the Windows-specific implementation of time.sleep there appears this code:
| // Check for pending SIGINT signal before resetting the event |
| if (PyErr_CheckSignals()) { |
| goto error; |
| } |
| ResetEvent(sigint_event); |
If a control-C event happens after PyErr_CheckSignals returns, but before ResetEvent is called, I believe that event may be lost.
This is probably a hard race window to hit, and I don't have a Windows development environment, so I have not confirmed that it is possible.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Bug description:
In the Windows-specific implementation of
time.sleepthere appears this code:cpython/Modules/timemodule.c
Lines 2341 to 2345 in b706ff0
If a control-C event happens after
PyErr_CheckSignalsreturns, but beforeResetEventis called, I believe that event may be lost.This is probably a hard race window to hit, and I don't have a Windows development environment, so I have not confirmed that it is possible.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows