ftplib strange behaviour

siggy2 at supereva.it siggy2 at supereva.it
Fri Dec 31 07:10:25 EST 2004


Hi,
I'm using
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]
on win32
I've noticed a strange (= not deterministic) behaviour of ftplib.py:
sometimes (not always) it fails (after a variable number of minutes
from 15 to 130) downloading a 150 MB BINARY file
(a big gzipped ascii file) with the traceback reported
below.
IMVHO this is not a timeout error because my script import
timeoutsocket.py (__version__ = "$Revision: 1.1.22.1 $"
__author__  = "Timothy O'Malley <timo at alum.mit.edu>")
to explicitly trap that...
and whenever a timeout occurs it is correctly reported and handled
(timeout set to 240 seconds)


Traceback (most recent call last):
File "C:\mydir\myscript.py", line 77, in downloadFile
result = ftpObject.retrbinary('RETR '+name, f.write)
File "C:\Python23\lib\ftplib.py", line 386, in retrbinary
return self.voidresp()
File "C:\Python23\lib\ftplib.py", line 221, in voidresp
resp = self.getresp()
File "C:\Python23\lib\ftplib.py", line 207, in getresp
resp = self.getmultiline()
File "C:\Python23\lib\ftplib.py", line 193, in getmultiline
line = self.getline()
File "C:\Python23\lib\ftplib.py", line 183, in getline
if not line: raise EOFError


In ftplib.py I read this comment:
[CUT]
# Internal: return one line from the server, stripping CRLF.
# Raise EOFError if the connection is closed
def getline(self):
[CUT]

May anyone explain me what is this?
Could this error be explained only as a ftp server problem?
TIA!
bye,
   PiErre




More information about the Python-list mailing list