ftplib retrlines timeout

J

Jennifer

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,timeout) 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
 
B

Brendan

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,timeout) 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 ''.
 
J

Jennifer

So you mean ftplib.FTP('xxxx.xxx.com',username,password,timeout) will
timeout the retrlines as well, correct? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top