-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. #112424
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
@AlexWaygood Thanks for alerting me to this issue. Would you be willing to review the fix? |
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'm generally not the person you'd want to review a change to C code, but this looks like a clean revert, so I'm confident in approving this. Thanks!
Okay, noted for the future. :-)
Ah yes, I should have elaborated in the PR description (and I've belatedly updated the PR description): the first commit is indeed a clean revert ( Thank you for reviewing! |
Thanks @mdickinson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @mdickinson, I could not cleanly backport this to
|
GH-112426 is a backport of this pull request to the 3.12 branch. |
…truct.Struct. (pythonGH-112424) Revert commit c8c0afc (PR pythonGH-94532), which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`. This caused issues with code in the wild that subclasses `struct.Struct`.. (cherry picked from commit 9fe6034) Co-authored-by: Mark Dickinson <[email protected]>
…Struct (GH-112424) (#112426) * [3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct. (GH-112424) Revert commit c8c0afc (PR GH-94532), which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`. This caused issues with code in the wild that subclasses `struct.Struct`.. (cherry picked from commit 9fe6034) Co-authored-by: Mark Dickinson <[email protected]> * Remove unrelated test
…truct. (python#112424) Revert commit c8c0afc (PR python#94532), which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`. This caused issues with code in the wild that subclasses `struct.Struct`.
…truct. (python#112424) Revert commit c8c0afc (PR python#94532), which moved `struct.Struct` initialisation from `Struct.__init__` to `Struct.__new__`. This caused issues with code in the wild that subclasses `struct.Struct`.
This PR reverts commit c8c0afc (PR #94532), which caused issues with code in the wild that subclasses
struct.Struct
.Note for reviewers: the first commit contains no manual changes: it's the result of a
git revert c8c0afc
followed bypython Tools/clinic/clinic.py -f Modules/_struct.c
to regenerate the argument clinic code.