STINNER Victor <victor.stin...@haypocalc.com> added the comment:

ftp_close.patch:
 - (in passive mode) FTP.ntransfercmd() closes explicitly the socket on error: 
the caller has not access to the socket on error
 - OtherNetworkTests of test_urllib2net clears CacheFTPHandler cache: add a 
CacheFTPHandler.clear_cache() for that (I didn't document this new method 
because other methods are also not documented)
 - the last change is the worst one (ugly hack): FTPHandler.ftp_open() changes 
the close callback of the addclosehook object in ftpwrapper.retrfile(), but not 
in CacheFTPHandler.

I don't like the implementation of the last change:
 - it adds a protected class attribute
 - ftpwrapper.retrfile() requires an explicit close=True argument: it would be 
better to use a "reference counter" (or something like that), like 
socket._io_refs

----------
keywords: +patch
Added file: http://bugs.python.org/file22392/ftp_close.patch

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

Reply via email to