
report at bugs
Oct 16, 2009, 11:43 AM
Post #14 of 41
(659 views)
Permalink
|
|
[issue2054] add ftp-tls support to ftplib - RFC 4217
[In reply to]
|
|
Giampaolo Rodola' <billiejoex [at] users> 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 <report [at] bugs> <http://bugs.python.org/issue2054> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|