[issue25619] Exception AttributeError: "'NoneType'.... thrown on exit

R. David Murray report at bugs.python.org
Fri Nov 13 14:41:26 EST 2015


R. David Murray added the comment:

Yes, python2 shutdown has this problem: modules and their attributes are set to None during interpreter shutdown.  Things are much better in python3.  If you want to avoid the error messages, finalize the objects explicitly (making sure to break gc cycles) before the end of your program, or keep explicit references to the objects you need during __del__ (eg: os_path = os.path in the global scope of your module).

As for your last comment, you are correct, the GC cleanup order is not deterministic.

----------
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list