[issue9141] Allow objects to decide if they can be collected by GC
Kristján Valur Jónsson
report at bugs.python.org
Tue Apr 17 00:05:52 CEST 2012
Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:
I've stumbled upon further cases of this problem, and a possible serious bug in python 3.
the _PyIOBase_finalize() will invoke a "close" method on the object if the object isn't closed. This is the same as the object having a __del__ method. Yet, these objects are not treated as having finalizers by the garbage collector, and indeed, _PyIOBase_finalize() is called by the tp_clear() slot of several derived types. Surely, if these objects define non-trivial 'close' members, they must not be called during garbage collection.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9141>
_______________________________________
More information about the Python-bugs-list
mailing list