[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

Serhiy Storchaka report at bugs.python.org
Sun Oct 5 23:52:00 CEST 2014


Serhiy Storchaka added the comment:

>From Doc/c-api/gcsupport.rst:

> Constructors for container types must conform to two rules:
> 
> #. The memory for the object must be allocated using :c:func:`PyObject_GC_New`
>    or :c:func:`PyObject_GC_NewVar`.
> 
> #. Once all the fields which may contain references to other containers are
> 
>    initialized, it must call :c:func:`PyObject_GC_Track`.

_pickle.Pickler and _pickle.Unpickler have the Py_TPFLAGS_HAVE_GC flag, implement tp_traverse and tp_clear, but PyObject_GC_Track is newer called.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18372>
_______________________________________


More information about the Python-bugs-list mailing list