-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases #26442
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
CC: @erlend-aasland |
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.
Thanks for the clarifications. I was pretty confused with your fix at 8b4312b. So I'm glad the reason is in the docs now!
If I'm understanding correctly, in that specific case, you want _ssl.SSLError
to inherit its tp_traverse
etc. fields from the parent PyExc_OSError
(which implements the GC), so you didn't set Py_TPFLAGS_HAVE_GC
in _ssl.SSLError
?
Correct, this is because SSLError doesn't add any extra fields: is just |
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9. |
GH-26443 is a backport of this pull request to the 3.10 branch. |
pythonGH-26442) (cherry picked from commit 8b55bc3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
GH-26444 is a backport of this pull request to the 3.9 branch. |
pythonGH-26442) (cherry picked from commit 8b55bc3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Thank you for the clarification! |
Yeah, thanks Pablo! This part wasn't obvious to me at all, especially the type inheritance part. FYI Pablo and me hit this issue the hard way while debugging a random crash involving the _ssl.SSLError exception: https://bugs.python.org/issue44252 Two unit tests only crashed on Windows, and only if you ran the unit test in a very specific way. GC collections are not really "determistic" from my human debugger pointer of view :-) I made the crash more likely by running |
https://bugs.python.org/issue44263