STINNER Victor <vstin...@python.org> added the comment:

There are limited options to fix this issue:

(A) Revert commit 364f0b0f19cc3f0d5e63f571ec9163cf41c62958

It would reintroduced bpo-35810 bug. Moreover, C extension modules which have 
been modified to call Py_DECREF(Py_TYPE(self)) in tp_dealloc which suddenly 
crash.

I don't think that anyone wants this option.


(B) Require all C extension modules authors to modify their tp_traverse 
function.

It requires to communicate well that all C extension modules which use 
PyType_FromSpec() need to modify their tp_traverse method to add code specific 
to Python 3.8 or newer.

Serhiy and me are against this option.


(C) Modify gcmodule.c to traverse the type.

This option is not trivial since *subtype* are already traversed. Moreover, 
Pablo and Tim are strongly against this option.


(D) Modify PyType_FromSpec() to hook into tp_traverse and transparently visit 
the type, as already done for subtypes.

Option chosen by PR 19414.

Honestly, I'm unhappy that we have to hook into tp_traverse, but this option 
sounds like the least bad option to me.

Developers don't have to modify their C extensions code, the bug is fixed.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40217>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to