-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
gh-95423: Updated winreg.DeleteKeyEx documentation for 32-bit OS. #95521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed some inaccuracies and added clarifications in the docstrings and documentation for winreg.DeleteKeyEx for how it behaves on 32-bit Windows.
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
Thanks, it's a good start. We don't need the note about The aim of our docs is to help Python developers use Python correctly. We don't need to provide historical or internal details of the platform, except where they are directly relevant to decisions that Python devs will have to make (and we are confident they won't change on us). Hopefully that helps guide your revisions. |
Thanks for the feedback @zooba. I tried my best to cut down some of the bloat. Let me know if you think it can be simplified further. Also, should I be committing the regenerated |
Ah yeah, because you modified the docstrings, you need to run |
pythongh-95423: Regenerated winreg code with updated docstrings. pythongh-95423: Fixed default role backticks
For future, please don't force push once people have started reviewing. We always squash merge and edit commit messages, so no need to worry about that, and force pushes just break incremental reviews (i.e. I can't see what changes you just made, I have to start reading again). |
Ah sorry, my bad. Noted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out the current state of the Reg function, and think we can drastically simplify. There aren't really any edge cases here anymore - it's just RegDeleteKeyExW all the time, and the WOW64 constants are ignored when they aren't relevant, so you can pass in anything you like.
Doc/library/winreg.rst
Outdated
.. note:: | ||
The :func:`DeleteKeyEx` function is implemented with the RegDeleteKeyEx | ||
Windows API function, which is specific to 64-bit versions of Windows. | ||
Windows API function, which is intended to be used for 64-bit Windows. | ||
On 32-bit systems, it is strongly recommended to use :func:`DeleteKey()` | ||
instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some more research, and it seems that there's no distinction on any modern Windows OS. RegDeleteKey
just calls RegDeleteKeyEx
directly and passes in zero for the extra parameter, so there isn't really any need for this note at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I removed the note completely.
PC/winreg.c
Outdated
Deletes the specified key (intended for 64-bit OS). | ||
|
||
While this function is intended to be used for 64-bit OS, it is also | ||
available on 32-bit systems. | ||
To use with 32-bit Windows, 0 must be passed in as the access argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deletes the specified key (intended for 64-bit OS). | |
While this function is intended to be used for 64-bit OS, it is also | |
available on 32-bit systems. | |
To use with 32-bit Windows, 0 must be passed in as the access argument. | |
Deletes the specified key. |
As above
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
…c loading for RegDeleteKeyExW().
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Thanks for the suggestions. I have made the requested changes; please review again. I think I was way too wordy and tunnel visioned on keeping the notes mentioned in the issue. I also simplified |
Thanks for making the requested changes! @zooba: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the one change (which I'll commit myself), this looks great!
@zooba Ah thanks for the note about the GIL around |
Hmm... that seems like an oversight. Would you like to get it? I'm fine to not worry about it and just merge as it is. |
No problem, I got it. |
Awesome work, thanks! |
Thanks @derekdkim for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Thanks @derekdkim for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, @derekdkim and @zooba, I could not cleanly backport this to |
Sorry @derekdkim and @zooba, I had trouble checking out the |
GH-95619 is a backport of this pull request to the 3.11 branch. |
…namic function load (pythonGH-95521)
GH-95622 is a backport of this pull request to the 3.10 branch. |
…namic function load (pythonGH-95521)
…function load (GH-95521) Co-authored-by: Derek Kim <ddkim1024@gmail.com>
…function load (GH-95521) Co-authored-by: Derek Kim <ddkim1024@gmail.com>
Documentation updates to address:
Issue #95423
Please let me know if my wording could use some improvement or if I missed any other part of the documentation.