[issue3826] BaseHTTPRequestHandler depends on GC to close connections

Gregory P. Smith report at bugs.python.org
Sat Nov 29 22:52:17 CET 2008


Gregory P. Smith <greg at krypto.org> added the comment:

Martin: socket.socket has no destructor so a call to
socket.socket._real_close() is not guaranteed.  Thats fine as its parent
class from socketmodule.c _socket.socket does the right thing in its
destructor.

Amaury: The case you show doesn't call SOCKETCLOSE() because x still
exists and holds a reference to the socket object.

In order to fix that, SocketIO needs to drop its reference on close. 
Take a look at the attached -gps04 patch.  It fixes that.

Added file: http://bugs.python.org/file12163/issue3826_socket-gps04.diff

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


More information about the Python-bugs-list mailing list