[Python-bugs-list] [ python-Bugs-459767 ] ftplib fails with files > 2GB
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 17 Oct 2001 07:03:19 -0700
Bugs item #459767, was opened at 2001-09-08 03:30
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470
Category: Python Library
Group: None
>Status: Open
Resolution: Fixed
Priority: 2
Submitted By: Martin Preishuber (preisl)
Assigned to: Guido van Rossum (gvanrossum)
Summary: ftplib fails with files > 2GB
Initial Comment:
The ftplib.py module is not ready for large files >
2GB. The funtions size and parse150 return integer
values as file size which causes overflows on large files.
----------------------------------------------------------------------
>Comment By: Martin Preishuber (preisl)
Date: 2001-10-17 07:03
Message:
Logged In: YES
user_id=29575
I just tried it ... the patch is basically ok, but int(s)
raises an ValueError, not an OverflowError with Python 2.1.1:
ValueError: int() literal too large: 2720628736
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-16 12:46
Message:
Logged In: YES
user_id=6380
I've fixed this in CVS. ftplib.py rev 1.59.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-16 12:13
Message:
Logged In: YES
user_id=6380
Can you verify that this patch works for you? (I don't have
a server with files > 2GB lying around, and my network would
take days to download them anyway. ;-( )
See the uploaded file "ftplib.patch.txt"
----------------------------------------------------------------------
Comment By: Martin Preishuber (preisl)
Date: 2001-10-16 11:03
Message:
Logged In: YES
user_id=29575
These changes are necessary:
For Python 1.*: replace atoi by atol in size() and parse150()
For Python 2.*: replace int by long in size() and parse150()
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-10 06:36
Message:
Logged In: YES
user_id=6380
Please upload your patches and I'll see...
----------------------------------------------------------------------
Comment By: Martin Preishuber (preisl)
Date: 2001-09-08 04:14
Message:
Logged In: YES
user_id=29575
well, I've written emirror, some ftp mirroring software.
There are people, who use it to make backups of such large
files. I already use some modified ftp library, which fixes
some bugs in the 1.52 library (those bugs are included in
>2.0 versions) and I have made the necessary changes for
large file support myself ... I just thought it'd be nice to
have that support generally.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-08 04:08
Message:
Logged In: YES
user_id=6380
Do you have an actual use for this, or it this just a
theoretical complaint? Show me an FTP server with a file >
2GB and I'll consider fixing it.
In the future (Python 2.3), int() will auto-convert to long
if necessary -- see PEP 237. So this will be fixed
eventually anyway -- probably long before such large files
will become an issue.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=459767&group_id=5470