[issue20032] asyncio.Future.set_exception() creates a reference cycle

STINNER Victor report at bugs.python.org
Fri Dec 20 23:15:01 CET 2013


STINNER Victor added the comment:

> Do you have an example of code that behaves differently with this patch?  I can't find any.

I didn't check in the Python standard library, but the reference cycle is obvious, and I hate such issue. It introduces tricky issues like memory leaks.

Here is an example to demonstrate the issue. The "DELETE OBJECT" message is never displayed, so the object is never deleted (memory leak).

Comment "fut.set_exception(err)" line to delete the object, or apply attached patch.

----------
Added file: http://bugs.python.org/file33238/never_deleted.py

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


More information about the Python-bugs-list mailing list