bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases#26442
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases#26442pablogsal merged 1 commit into
Conversation
Fidget-Spinner
left a comment
There was a problem hiding this comment.
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?
Sorry, something went wrong.
Correct, this is because SSLError doesn't add any extra fields: is just |
Sorry, something went wrong.
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9. |
Sorry, something went wrong.
pythonGH-26442) (cherry picked from commit 8b55bc3) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
Thank you for the clarification! |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
https://bugs.python.org/issue44263