[ python-Feature Requests-1177998 ] Add a settimeout to ftplib.FTP object
SourceForge.net
noreply at sourceforge.net
Fri Mar 30 15:02:48 CEST 2007
Feature Requests item #1177998, was opened at 2005-04-06 15:52
Message generated for change (Comment added) made by facundobatista
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1177998&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Juan Antonio Valiño García (juanval)
Assigned to: Facundo Batista (facundobatista)
Summary: Add a settimeout to ftplib.FTP object
Initial Comment:
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 !
----------------------------------------------------------------------
>Comment By: Facundo Batista (facundobatista)
Date: 2007-03-30 10:02
Message:
Logged In: YES
user_id=752496
Originator: NO
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!
----------------------------------------------------------------------
Comment By: Collin Winter (collinwinter)
Date: 2007-03-30 04:23
Message:
Logged In: YES
user_id=1344176
Originator: NO
Facundo, I believe you're doing something along these lines, right?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1177998&group_id=5470
More information about the Python-bugs-list
mailing list