473,705 Members | 5,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.p y (__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\myscr ipt.py", line 77, in downloadFile
result = ftpObject.retrb inary('RETR '+name, f.write)
File "C:\Python23\li b\ftplib.py", line 386, in retrbinary
return self.voidresp()
File "C:\Python23\li b\ftplib.py", line 221, in voidresp
resp = self.getresp()
File "C:\Python23\li b\ftplib.py", line 207, in getresp
resp = self.getmultili ne()
File "C:\Python23\li b\ftplib.py", line 193, in getmultiline
line = self.getline()
File "C:\Python23\li b\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 2258
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 misconficuratio n 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
1661
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 found. I find this behaviour very strange. Why not simply return an empty list?
0
3007
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 ftp.nlst() returns an empty list which seems somehow strange to me. Here is, what I did: >>> from ftplib import FTP >>> HOST = 'my.server' >>> USER = 'myuser'
2
9572
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 *' with no success. I am using the following: srcFtp = FTP(srcHost) srcFtp.login(srcUser, srcPass) srcDir = srcFtp.nlst('.')
1
6485
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 ftplib.getline even though my file is actually transferred. Here's my script: def uploadViaFtp(self, file, filename):
0
8768
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8690
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9274
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9139
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9034
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2491
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2083
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.