[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

STINNER Victor report at bugs.python.org
Thu Feb 21 06:21:02 EST 2019


STINNER Victor <vstinner at redhat.com> added the comment:

> I thought that local-variables were deterministically (ref-countering) destructed. What is happening?

IT's a reference cycle. Exception => traceback => frame => exception. The 'err' variable kept the frame alive which kept the exception alive which kept everything alive. The GC is supposed to be able to break ref cycles, but GC collections are irregular and sometimes the GC fails to break complex cycles.

----------

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


More information about the Python-bugs-list mailing list