bpo-44263: Fix _decimal and _testcapi GC protocol#26464
bpo-44263: Fix _decimal and _testcapi GC protocol#26464vstinner merged 1 commit intopython:mainfrom vstinner:fix_gc_types
Conversation
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function.
|
It's possible to access the internal |
|
PyDecSignalDictMixin_Type doesn't contain any Python object. It cannot be part of a reference cycle. So it doesn't have to be tracked by the GC. Its structure only contains 32-bit flags: |
|
The following script does crash in |
Is it worth it adding this as a regression test? |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
GH-26465 is a backport of this pull request to the 3.10 branch. |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <vstinner@python.org>
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
GH-26466 is a backport of this pull request to the 3.9 branch. |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <vstinner@python.org>
|
@vstinner is the issue number correct? |
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* _testcapi.heapgctype: implement a traverse function since the type is defined with Py_TPFLAGS_HAVE_GC. * _decimal: PyDecSignalDictMixin_Type is no longer defined with Py_TPFLAGS_HAVE_GC since it has no traverse function. (cherry picked from commit 142e5c5) Co-authored-by: Victor Stinner <vstinner@python.org>
|
I consider that my PR #26463 is generic check for such bug. |
|
The _ssl.SSLError fix was merged with no test: see #26439 |
is defined with Py_TPFLAGS_HAVE_GC.
Py_TPFLAGS_HAVE_GC since it has no traverse function.
https://bugs.python.org/issue44263