Antoine Pitrou added the comment:

For a more detailed analysis:
- the warning gets printed very late because the socket is caught in a 
reference cycle (self.attr = self), which itself is tied to the exception 
traceback
- when the socket is collected, it tries to print a ResourceWarning because it 
hasn't been closed explicitly (just add self.close() in the constructor to make 
it disappear)
- when trying to print the ResourceWarning, it probably wants to import 
linecache or something, and that breaks

The only remaining mystery is why there are 200 lines and not just one :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21049>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to