473,395 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ftplib strange behaviour

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 <ti**@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

Jul 18 '05 #1
2 2208
PiErre,

I have used ftplib but never for such a huge file (assuming your
problem is related to the size of the file).

Have you tried downloading the file using another ftp client? Does that
download succeed? The reason I ask is because I have attempted
downloads from servers that terminate the connection after a certain
connection time, in the middle of a download!

That is the best I can help you out with the information.
Have a happy New Year.

Thanks,
--Kartic

Jul 18 '05 #2
Kartic wrote:
I have used ftplib but never for such a huge file (assuming your
problem is related to the size of the file). we're doing that since python 2.2 from different site to different
hosts where our script was installed...
needless to say all the (few) problems we had came from the servers...
Have you tried downloading the file using another ftp client? Does that download succeed? The reason I ask is because I have attempted
downloads from servers that terminate the connection after a certain
connection time, in the middle of a download! After two weeks the sysadms of the ftp server
discovered a misconficuration in some router... Anyway
we had already change the script: we managed to trap any exception and

we added a "retry" loop.

That is the best I can help you out with the information.

Thank you for your help anyway.

bye,
PiErre

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mikael | last post by:
Hello, I am using the ftplib.FTP.nlst() method to list the files in a directory on a FTP server. But when the directoty is empty, python raises an error: ftplib.error_perm: 550 No files...
0
by: Nico Grubert | last post by:
Hi there, I am using the ftplib library to connect to a ftp server. After I got connected, I can see a list of file in the current directory using ftp.dir() or ftp.retrlines('LIST'). But using...
2
by: Harlin Seritt | last post by:
Using ftplib from Python I am trying to get all files in a particular directory using ftplib and then send those same files to another ftp server. I have tried using commands like 'get *' and 'mget...
1
by: Jon Bowlas | last post by:
Hi All, I've written a little method to connect to an ftpserver which works well, however when I send a file using this ftp connection oddly I _sometimes_ get returned an EOFError from...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.