[issue21925] ResourceWarning sometimes doesn't display

STINNER Victor report at bugs.python.org
Thu Mar 24 11:10:48 EDT 2016


STINNER Victor added the comment:

It looks like the warnings is logged when the C implemention is used. When the Python implementation is used, "import linecache" or "linecache.getline()" fail, and so the warnings is skipped.

Attached patch makes the Python implementation safer when Python is shutting down. Add "try/except Exception" to ignore exceptions on import, linecache and tracemalloc.

----------
Added file: http://bugs.python.org/file42276/warnings_shutdown.patch

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


More information about the Python-bugs-list mailing list