Title: Potential Windows-specific lost event race in the implementation of time.sleep · Issue #135407 · python/cpython · GitHub
Open Graph Title: Potential Windows-specific lost event race in the implementation of time.sleep · Issue #135407 · python/cpython
X Title: Potential Windows-specific lost event race in the implementation of time.sleep · Issue #135407 · python/cpython
Description: Bug description: In the Windows-specific implementation of time.sleep there appears this code: cpython/Modules/timemodule.c Lines 2341 to 2345 in b706ff0 // Check for pending SIGINT signal before resetting the event if (PyErr_CheckSignal...
Open Graph Description: Bug description: In the Windows-specific implementation of time.sleep there appears this code: cpython/Modules/timemodule.c Lines 2341 to 2345 in b706ff0 // Check for pending SIGINT signal before r...
X Description: Bug description: In the Windows-specific implementation of time.sleep there appears this code: cpython/Modules/timemodule.c Lines 2341 to 2345 in b706ff0 // Check for pending SIGINT signal before r...
Opengraph URL: https://github.com/python/cpython/issues/135407
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Potential Windows-specific lost event race in the implementation of time.sleep","articleBody":"### Bug description:\n\nIn the Windows-specific implementation of `time.sleep` there appears this code:\n\nhttps://github.com/python/cpython/blob/b706ff003c536c5bca24dfdd3a8917bffcfa3df1/Modules/timemodule.c#L2341-L2345\n\nIf a control-C event happens after `PyErr_CheckSignals` returns, but before `ResetEvent` is called, I believe that event may be lost.\n\nThis 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.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nWindows","author":{"url":"https://github.com/zackw","@type":"Person","name":"zackw"},"datePublished":"2025-06-11T19:44:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/135407/cpython/issues/135407"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aaea0f5a-a3e0-f189-0d31-1ef91e401c58 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABB8:3CE4A4:262197:3441CE:6A558F95 |
| html-safe-nonce | 1c90f0a002bffbb270112ea1d7a0559a37d5e3d620a53b5e125d827e9dde413b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkI4OjNDRTRBNDoyNjIxOTc6MzQ0MUNFOjZBNTU4Rjk1IiwidmlzaXRvcl9pZCI6IjMwOTMxOTc5MTAzNDkwMjUxNzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b5bbdf9663543351d62b0fbe649f65577bc06cbafb8dab531a9145277adf33c5 |
| hovercard-subject-tag | issue:3137923969 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/135407/issue_layout |
| twitter:image | https://opengraph.githubassets.com/feef12d81a4f9438ae9d5f5dbca684f7bfaedb8aaa92cfe8322764e324c75445/python/cpython/issues/135407 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/feef12d81a4f9438ae9d5f5dbca684f7bfaedb8aaa92cfe8322764e324c75445/python/cpython/issues/135407 |
| og:image:alt | Bug description: In the Windows-specific implementation of time.sleep there appears this code: cpython/Modules/timemodule.c Lines 2341 to 2345 in b706ff0 // Check for pending SIGINT signal before r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zackw |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | aa21baa44893467b0b640d0300538f84ca8c475b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width