Title: Convert Windows handle bitfields by youknowdot · Pull Request #9649 · RustPython/RustPython · GitHub
Open Graph Title: Convert Windows handle bitfields by youknowdot · Pull Request #9649 · RustPython/RustPython
X Title: Convert Windows handle bitfields by youknowdot · Pull Request #9649 · RustPython/RustPython
Description: Summary Apply CPython 3.15's pointer-width F_HANDLE / F_POINTER bitfield conversion to six single-argument _winapi functions: CloseHandle, DeregisterEventSource, GetExitCodeProcess, GetModuleFileName, UnmapViewOfFile, and VirtualQuerySize. Apply CPython’s 32-bit unsigned-long k conversion to _winapi.GetStdHandle, including negative standard-handle constants. Accept integer and __index__ inputs, preserve the relevant low bits, and warn on out-of-range values. A warning promoted to an error stops before the Windows call. Bind the raw argument before conversion, so malformed keyword calls cannot run the new conversion first. Keep the original object alive through the operation and construction of its return value. Builtin integer inputs are borrowed without an extra Python integer allocation. Keep the shared WinHandle conversion and return representation unchanged for other APIs. This is a scoped input-conversion improvement, not a claim of full parity for these seven APIs. In particular, RustPython's existing __index__ diagnostic behavior has edge differences, and GetModuleFileName retains its existing error and UTF-16 handling differences, and GetStdHandle retains the existing signed representation of high-bit returned handles. Validation Compared the seven generated Clinic wrappers and the k/K converters with CPython 3.15.0 source. CPython-only C-API probes checked 64-bit boundaries, masking, warnings, __index__, argument errors and multibyte type-name truncation, plus 32-bit unsigned-long boundaries and standard-handle values. Independent source review and normal repository hooks passed. No new snippet or Rust-hosted Python behavior tests were added. RustPython was not executed locally; Windows compile/runtime validation remains for CI. A staged integration with #9572 and #9574 retains their parameter names and timeout conversion; the two #9572 source conflicts require those reviewed resolutions if the changes land together. Assisted-by: dot:frontier-intelligence Summary by CodeRabbit New Features Windows API functions now accept integer-like objects for handle and address arguments, including objects that support integer conversion. Bug Fixes Invalid argument conversions are reported before the Windows API is called, with clearer errors for unsupported values. Values outside the supported bit width continue to be converted using their masked value and now emit a deprecation warning.
Open Graph Description: Summary Apply CPython 3.15's pointer-width F_HANDLE / F_POINTER bitfield conversion to six single-argument _winapi functions: CloseHandle, DeregisterEventSource, GetExitCodeProcess, GetModuleF...
X Description: Summary Apply CPython 3.15's pointer-width F_HANDLE / F_POINTER bitfield conversion to six single-argument _winapi functions: CloseHandle, DeregisterEventSource, GetExitCodeProcess, GetMod...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9649
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:b7b97168-f098-ac91-dc09-d4042543052a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B58:27E5CD:3BEE4F4:4C9A445:6B01FE80 |
| html-safe-nonce | dca2dc83839de2633f30170ab7569887ae6efaad1c63cab5ad4701c75036fa05 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjU4OjI3RTVDRDozQkVFNEY0OjRDOUE0NDU6NkIwMUZFODAiLCJ2aXNpdG9yX2lkIjoiNjQ3NjUzNjk4NzM3MjM1NTIwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7c076c6c5ce0c9752970955bfa597d21d1770039f1718fa3a38413a8b7c81819 |
| hovercard-subject-tag | pull_request:5141016385 |
| 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/9649/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 Apply CPython 3.15's pointer-width F_HANDLE / F_POINTER bitfield conversion to six single-argument _winapi functions: CloseHandle, DeregisterEventSource, GetExitCodeProcess, GetModuleF... |
| 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 full-width |
| 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