Daniel Stutzbach <dan...@stutzbachenterprises.com> added the comment:

The purpose of calling .close() in __del__ is to close the socket when the 
owner is destroyed yet the program is still running.

This prevents the socket from staying open if some other part of the program 
has somehow acquired a reference to it.  telnetlib, urllib, and even the socket 
module itself contain classes that call .close() within __del__ for this 
purpose.

Unfortunately, that can result in ugly error messages when the interpreter is 
exiting.

----------

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

Reply via email to