Issue 1177998: Add a settimeout to ftplib.FTP object (original) (raw)

Issue1177998

Created on 2005-04-06 18:52 by juanval, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg54428 - (view) Author: Juan Antonio Valiño García (juanval) Date: 2005-04-06 18:52
It will be usefull that the FTP object of ftplib had a settimeout method to setup a timeout for the connection, because the only way of doing this is to use the socket.setdefaulttimeout method, and this is very dangerous when you are using threads. Thanks and keep up the work !
msg54429 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-30 07:23
Facundo, I believe you're doing something along these lines, right?
msg54430 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2007-03-30 13:02
It's already in the trunk, you can do this: >>> ftp = ftplib.FTP("localhost", timeout=30) ... or ... >>> ftp = ftplib.FTP() >>> ftp.connect("localhost", timeout=30) ... or ... >>> ftp = ftplib.FTP(timeout=30) >>> ftp.connect("localhost") ... or ... >>> ftp = ftplib.FTP() >>> ftp.timeout = 30 >>> ftp.connect("localhost") :D Thanks Collin!
History
Date User Action Args
2022-04-11 14:56:10 admin set github: 41816
2005-04-06 18:52:52 juanval create