Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ftplib retrlines timeout

Reply
Thread Tools

ftplib retrlines timeout

 
 
Jennifer
Guest
Posts: n/a
 
      12-15-2009
I am writing a program that has a requirement for a timeout of
retrlines after the connection established. I just wonder if timeout
of ftplib.FTP('xxxx.xxx.com',username,password,timeou t) will work for
retrlines method after the connection established. Or
socket.setdefaulttimeout will work in this case. Please let me know.

What exception will be throwed if ftp.retrlines timed out.

Many Thanks!

- Jennifer
 
Reply With Quote
 
 
 
 
Brendan
Guest
Posts: n/a
 
      12-16-2009
On Dec 15, 6:17*pm, Jennifer <(E-Mail Removed)> wrote:
> I am writing a program that has a requirement for *a timeout of
> retrlines after the connection established. I just wonder if timeout
> of ftplib.FTP('xxxx.xxx.com',username,password,timeou t) will work for
> retrlines method after the connection established. Or
> socket.setdefaulttimeout will work in this case. Please let me know.
>
> What exception will be throwed if ftp.retrlines timed out.
>
> Many Thanks!
>
> - Jennifer


I asked a similar question on here a few days ago and got no response,
however I tried a large download which timed out with the following:
Traceback (most recent call last):
File "./download_r1_neodf.py", line 167, in <module>
result = ftp.quit()
File "/usr/local/lib/python2.6/ftplib.py", line 566, in quit
resp = self.voidcmd('QUIT')
File "/usr/local/lib/python2.6/ftplib.py", line 248, in voidcmd
return self.voidresp()
File "/usr/local/lib/python2.6/ftplib.py", line 223, in voidresp
resp = self.getresp()
File "/usr/local/lib/python2.6/ftplib.py", line 209, in getresp
resp = self.getmultiline()
File "/usr/local/lib/python2.6/ftplib.py", line 195, in getmultiline
line = self.getline()
File "/usr/local/lib/python2.6/ftplib.py", line 182, in getline
line = self.file.readline()
File "/usr/local/lib/python2.6/socket.py", line 406, in readline
data = self._sock.recv(self._rbufsize)
socket.error: [Errno 110] Connection timed out


BTW, if you want to use the timeout paramter, you must also use the
account parameter. Set it to ''.
 
Reply With Quote
 
 
 
 
Jennifer
Guest
Posts: n/a
 
      12-16-2009
So you mean ftplib.FTP('xxxx.xxx.com',username,password,timeou t) will
timeout the retrlines as well, correct? Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP.retrlines help fabio.geraci Python 0 01-14-2011 02:43 PM
Python 2.6 ftplib has timeout parameter, but how to detect a timeout Brendan Python 4 12-30-2009 07:35 PM
ftp retrlines with re... isabellknauer@googlemail.com Python 2 12-08-2008 10:40 AM
Re: ftplib and retrbinary or retrlines (losing newlinecharacters in my log files) Gabriel Genellina Python 0 01-28-2007 11:23 PM
Re: ftplib and retrbinary or retrlines (losing newlinecharacters in my log files) Gabriel Genellina Python 0 01-25-2007 06:28 AM



Advertisments