Giampaolo Rodola' <billiej...@users.sourceforge.net> added the comment:
> From a quick look at the patch, if you call login() twice, the socket > will be wrapped twice as well? Perhaps auth_tls() should have a > protection against this. You're right. Done. > In prot_p() and prot_c(), it seems that self._prot_p is updated > unconditionally, regardless of the FTP response. Both PROT P and PROT C commands expect a 2xx response. That's why I used voidcmd(). If a response different than 2xx is received voidcmd() automatically raises an error_reply exception already and self._prot_p doesn't get set. > One more question, why is "ssl_version=ssl.PROTOCOL_TLSv1" hardwired? You're right, it shouldn't be. This is now provided as a class attribute. The reason I used PROTOCOL_TLSv1 instead of PROTOCOL_SSLv23 (the ssl.py default) is because RFC-4217 recommends it. > In retrbinary(), retrlines(), storbinary() and storlines(), you > certainly want some try/finally blocks so that the data connection > always gets closed at the end. I agree, it's a good practice. I avoided to do that because the original FTP class is coded like that. Anyway, this is done too now. Modified patch is in attachment. I hope I'll be able to work on tests and documentation during this week- end. ---------- Added file: http://bugs.python.org/file15146/ftplib.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2054> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com