-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix: call 'PyObject_ClearWeakRefs' unconditionally #324
Conversation
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.
@tseaver Do we also need to call PyObject_ClearWeakRefs in the tp_dealloc functions for the other types that use BASETYPE_FLAGS?
7ca6275 tries to comply across the board. PTAL. |
@tseaver The tests pass, but some errors are logged when I run
That comes from here: https://github.com/python/cpython/blob/3.11/Objects/weakrefobject.c#L951 Apart from SB, the other types only have Py_TPFLAGS_MANAGED_WEAKREF (via BASETYPE_FLAGS) when USE_EXPLICIT_WEAKREFLIST is 0 (in Python 3.12+) so we should probably also use that condition for calling PyObject_ClearWeakRefs here. Or else take Py_TPFLAGS_MANAGED_WEAKREF back out of BASETYPE_FLAGS and only add it for SpecificationBase |
@tseaver knock knock - do you have a little time to finish this? |
@tseaver @dataflake I updated this branch with my second suggestion from above, which resolves the errors I mentioned. |
I can't say much about the C code changes because that's not my expertise, but if it fixes the issues it's OK for merging. |
@davisagli 2524dc6 LGTM -- thanks for taking up my slack! |
Plone gives a segmentation fault when used with Zope 5.11. This PR fixes it. Can we have a release please? I might be able to make a release myself, at least I should have PyPI rights. But I am not sure how that goes with the C code, so I might unknowingly break something. BTW, after Zope 5.11 was released I reported that the Plone tests passed, but apparently this segfault managed to hide itself... |
I cannot do a release, I am traveling without access to a computer. |
I wanted to try, but apparently I don't have rights to upload to PyPI anyway, which surprises me as I am part of the zope pypi organisation. |
@mauritsvanrees @dataflake I released zope.interface 7.1.1 |
Toward #323.
@stollero Could you test with this patch to see if it fixes #323?