STINNER Victor <victor.stin...@haypocalc.com> added the comment: Ok, some news about this bug (I tested the ftp test account): the problem is that the data socket is not closed when self.voidresp() is called. I can't see close() syscall before the call to self.voidresp(). SocketIO.close() does nothing: it does not really close the socket, just the file. And socket.close() does also nothing because there is still an io reference... the closed file :-/ The io reference counter is only updated when the file is destroyed. conn = <create a socket> # conn._io_refs=0 fp = conn.makefile('r', encoding=self.encoding) # conn._io_refs=1 ... fp.close() # only set fp.closed to True conn.close() # only set conn._closed to True # conn._io_refs=1 and the socket (file descriptor) is still open del fp # conn._io_refs=0 -> the socket is finally closed!
_______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4791> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com