ftplib strange behaviour

Discussion in 'Python' started by siggy2@supereva.it, Dec 31, 2004.

  1. Guest

    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 <>")
    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
     
    , Dec 31, 2004
    #1
    1. Advertising

  2. Kartic Guest

    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
     
    Kartic, Jan 1, 2005
    #2
    1. Advertising

  3. Guest

    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
     
    , Jan 18, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    760
    Steve Holden
    Sep 12, 2003
  2. Gerrit Holl
    Replies:
    0
    Views:
    904
    Gerrit Holl
    Dec 29, 2003
  3. Michael_Goettsche

    Uploading a file with ftplib

    Michael_Goettsche, Jan 1, 2004, in forum: Python
    Replies:
    2
    Views:
    357
    Michael_Goettsche
    Jan 1, 2004
  4. Mikael
    Replies:
    0
    Views:
    415
    Mikael
    Jul 14, 2004
  5. Andy Chambers
    Replies:
    1
    Views:
    395
    Daniel Dyer
    May 14, 2007
Loading...

Share This Page