[issue23865] Fix possible leaks in close methods

Martin Panter report at bugs.python.org
Thu Apr 9 00:11:18 CEST 2015


Martin Panter added the comment:

Okay, I think I get it. You are setting some attributes to None, in case they happen to be causing a reference cycle. When close() is called, they are no longer needed, so it might help to breaking potential reference cycles. I have often wondered why this was done. I always assumed it was a carry-over from old code relying on the garbage collector to automatically close files, etc.

----------

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


More information about the Python-bugs-list mailing list