[Python-bugs-list] [ python-Bugs-438931 ] ftplib crash

noreply@sourceforge.net noreply@sourceforge.net
Fri, 17 Aug 2001 10:29:29 -0700


Bugs item #438931, was opened at 2001-07-05 17:12
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438931&group_id=5470

Category: Python Library
>Group: Irreproducible
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: ftplib crash

Initial Comment:
I've found a rather horrible problem when using ftplib.
I'm running python2.1 and linux kernel 2.4.4

I haven't had a chance to check this out on any other
machines, I don't want to bring down a server testing this.

This code makes my system hang when I try to upload a
file of 4 megs or 100 megs. It works for 22 bytes (my
other test file):

def copyDepot(self, depot):
        import ftplib, stat
        depot.mFullPath = "/tmp/" + depot.mFile
        ftp = ftplib.FTP(self.mHost)
        ftp.login(self.mUser,self.mPass)
        f = open(depot.mLocalPath, 'r+')
        ftp.storbinary("STOR " + depot.mFullPath, f, 8192)
        size = ftp.size(depot.mFullPath)
        lsize = os.stat(depot.mLocalPath)[stat.ST_SIZE]
        ftp.quit()
        print "Remote Size: ",size
        print "Local Size: ",lsize
        if size != os.stat(depot.mLocalPath)[stat.ST_SIZE]:
            raise "Size does not match!"

Any ideas? Has anybody heard of something like this
happening? What would you suggest I do to fix it if its
not python?


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-17 10:29

Message:
Logged In: YES 
user_id=6380

Haven't heard back in over a month. Closing this now.

I suspect this was a case of binary vs. text mode on either
the client
or the server.

Notice that the code uses mode 'r+' which doesn't make
sense,
suggesting a newbie at work.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-07-08 14:09

Message:
Logged In: YES 
user_id=21627

Can you analyze in more detail as to how exactly the two 
files differ (e.g. finding a byte offset and a few bytes 
around the first difference)?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=438931&group_id=5470