GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — bpo-42972: _thread.RLock type implements tp_traverse by vstinner · Pull Request #26734 · python/cpython Conversation
|
|
Leak discovered by #26727 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The _thread.RLock type now fully implement the GC protocol: add a traverse function and the Py_TPFLAGS_HAVE_GC flag.
|
Don't we have a warning for when heap types don't implement a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
No, the warning is when a heap type has the GC flags but don't have tp_traverse. in this case we were missing the GC flags so the check failed to raise the warning |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree that a warning should be emitted at runtime when a heap type doesn't have the Py_TPFLAGS_HAVE_GC or doesn't implement tp_traverse. I suggest to discuss this idea in https://bugs.python.org/issue42972 It's super hard to discover such very tricky bug if you don't have a very deep understanding of GC internals and how Python works. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The _thread.RLock type now fully implement the GC protocol: add a traverse function and the Py_TPFLAGS_HAVE_GC flag. (cherry picked from commit 1cd3d85) Co-authored-by: Victor Stinner <[email protected]>
|
GH-26735 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The _thread.RLock type now fully implement the GC protocol: add a traverse function and the Py_TPFLAGS_HAVE_GC flag. (cherry picked from commit 1cd3d85) Co-authored-by: Victor Stinner <[email protected]>
|
Thanks for your reviews @pablogsal and @shihai1991 ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The _thread.RLock type now fully implement the GC protocol: add a traverse function and the Py_TPFLAGS_HAVE_GC flag.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.