Title: Mask Windows single-wait timeouts by youknowdot · Pull Request #9574 · RustPython/RustPython · GitHub
Open Graph Title: Mask Windows single-wait timeouts by youknowdot · Pull Request #9574 · RustPython/RustPython
X Title: Mask Windows single-wait timeouts by youknowdot · Pull Request #9574 · RustPython/RustPython
Description: Summary _winapi.WaitForSingleObject currently maps every negative timeout to INFINITE. CPython 3.15 parses the argument as a Windows unsigned-long bitfield: for example, -2 becomes 0xfffffffe rather than 0xffffffff, so the current behavior can wait indefinitely instead of using the requested timeout. Accept indexable integers of arbitrary size and use their low 32 bits. Match CPython's integer value out of range DeprecationWarning outside [-231, 232-1], propagating it when warnings are errors before starting the wait. Preserve handle-first conversion and reject non-indexable values without invoking the wait. This follows the CPython 3.15 Clinic wrapper, k argument conversion, and PyLong_AsNativeBytes. For an unusually long type name where a multibyte character crosses CPython's 50-byte diagnostic cutoff, RustPython preserves a valid UTF-8 boundary and may differ in the diagnostic. This change overlaps #9572; integration must preserve that PR's parameter names as well as this conversion. Validation Independent source review checked the integer range boundaries, low-bit masking, error and warning order, and warning-as-error path against CPython's code. rustfmt --edition 2024 --check, git diff --check, and the normal commit hook passed. Windows runtime, RustPython workspace/C API, and target tests were not run locally: the coordinated native execution guard and lock are absent and the offline dependency cache is incomplete. Hosted CI is pending. In particular, no live wait behavior or warning filter result is claimed as tested. AI assistance Implementation and source review were assisted by dot. The runtime does not expose its exact model version. Summary by CodeRabbit Bug Fixes Windows wait timeouts now accept integer-like values. Values that cannot be interpreted as integers raise a TypeError, while errors raised during integer conversion are preserved. Timeouts outside the supported range trigger a deprecation warning and are converted using unsigned 32-bit wrapping. Negative values no longer automatically mean an infinite timeout.
Open Graph Description: Summary _winapi.WaitForSingleObject currently maps every negative timeout to INFINITE. CPython 3.15 parses the argument as a Windows unsigned-long bitfield: for example, -2 becomes 0xfffffffe rathe...
X Description: Summary _winapi.WaitForSingleObject currently maps every negative timeout to INFINITE. CPython 3.15 parses the argument as a Windows unsigned-long bitfield: for example, -2 becomes 0xfffffffe rathe...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9574
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:40744ac0-cce1-d703-1fa0-fe9a566afa5a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9328:1DC4CC:158F0E7:1CB3498:6B0202A4 |
| html-safe-nonce | a2bc8d638ad9ef56f7f6739c558b76b1e9a8974eef0f74985edb08f332a3c4ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzI4OjFEQzRDQzoxNThGMEU3OjFDQjM0OTg6NkIwMjAyQTQiLCJ2aXNpdG9yX2lkIjoiNzM1OTY3NDc2ODQzNTU3NzUwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7f22676b5c7f9403c8cd558a42dce16fe4ce7cb2960e44618da76edd92569dc9 |
| hovercard-subject-tag | pull_request:5136150190 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/RustPython/RustPython/pull/9574/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary _winapi.WaitForSingleObject currently maps every negative timeout to INFINITE. CPython 3.15 parses the argument as a Windows unsigned-long bitfield: for example, -2 becomes 0xfffffffe rathe... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width