[ftputil] ftputil timeout

Stefan Schwarzer sschwarzer at sschwarzer.net
Sat Sep 29 22:27:35 CEST 2007


Hi Ian,

Sorry for the late answer.

On 2007-09-27 10:15, Ian Bugeja wrote:
> basically i'm uploading some files using ftputil and whenever the upload
> time takes longer than 10minutes i get the following exception:
>  
> 421 Connection timed out - closing. Debugging info: ftputil 2.2.1,
> Python 2.5 (win32)
>  
> any ideas how i can increase this timeout or do something else please?

The timeout is set in the FTP server configuration. You can't do
anything about the timeout on the client side. In the past, I thought
a lot about gracefully recovering from timeouts but only got to
awkward "solutions".

That said, in your case the problem is that you actually have at least
_two_ FTP connections: one in the background that was opened upon
generation of the FTPHost instance and one for the remote file you
are uploading. If you steadily transfer data during the upload, the
problem must be with the original connection.

If no one else comes up with a better idea, you can program a
workaround by issuing ftphost_instance.chdir(ftphost_instance.curdir)
in another thread. (Using getcwd won't work because this merely gets
a cached value from the FTPHost instance without accessing the FTP
server at all.)

If you think that ftputil should implement such a workaround by
itself, please file a bug report on the website,
http://ftputil.sschwarzer.net/trac/wiki/IssueTracker . To enter a
bug report, you have to login with ftputiluser and ftputil as
username and password, respectively.

Best regards,
Stefan


More information about the ftputil mailing list