[issue13714] Methods of ftplib never ends if the ip address changes

Giampaolo Rodola' report at bugs.python.org
Thu Jan 5 11:28:14 CET 2012


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

Since you say the connection hangs I think you can set a timeout:

>>> ftp = ftplib.FTP(..., timeout=30)

That is applied to both control and data connection (and hence storbinary). This way you should get a socket.timeout exception after 30 seconds.

----------

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


More information about the Python-bugs-list mailing list