[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

STINNER Victor report at bugs.python.org
Fri Oct 30 13:01:05 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

> Issue26789. asyncio creates reference loops which caused to executing code late at shutdown, and that code uses logging which always fail.

Well, I suggest to attempt fixing logging.

The reference cycle in asyncio.Task.set_exception() is *by design*. It's really trick to fix it. Since the creation of asyncio, nobody managed to find a solution to fix it. Once I propose to create an asyncio task forcing a GC collection every minute, but it was never implemented.

If you have a clever idea to fix Task.set_exception() design, please open a separated issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue26789>
_______________________________________


More information about the Python-bugs-list mailing list