Skip to content

Match CPython HKEY argument conversion - #9586

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/winreg-hkey-conversion-20261103
Nov 4, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/winreg-hkey-conversion-20261103

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Match CPython 3.15's clinic_HKEY_converter for the existing HKEYArg users: DeleteTree, QueryInfoKey, QueryValue, and QueryValueEx.
  • Accept PyHKEY instances and integer handles, including negative values representable by a signed pointer, while rejecting None and non-integer __index__ objects with CPython's errors.
  • Preserve the full unsigned pointer range and platform-specific overflow diagnostics without Python integer boxing.

This only changes the shared converter's current callers. Other winreg functions that still require PyHkey are outside this patch; it does not assert complete winreg parity. The converter hunk is separate from #9573's signature changes in the same file.

Validation

  • Independently reviewed against CPython v3.15.0 PC/winreg.c, PC/clinic/winreg.c.h, and Objects/longobject.c, including Windows 32-bit and 64-bit conversion bounds and errors.
  • prek hooks and git diff --check passed.
  • No RustPython compilation or Windows runtime test was run locally; CI is needed.

Accept signed and unsigned pointer-width integer handles, reject index-only objects, and report the same None and overflow errors as CPython. Preserve the existing PyHKEY handle path.

Assisted-by: dot:frontier-intelligence
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@youknowone
youknowone marked this pull request as ready for review November 4, 2026 10:59
@youknowone
youknowone merged commit 3485237 into RustPython:main Nov 4, 2026
28 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T11:02:16.765308Z 9673534 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants