[Python-bugs-list] [ python-Bugs-683061 ] gzip module cannot write large files

SourceForge.net noreply@sourceforge.net
Wed, 28 May 2003 18:20:46 -0700


Bugs item #683061, was opened at 2003-02-08 11:52
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=683061&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ben Escoto (bescoto)
Assigned to: Nobody/Anonymous (nobody)
Summary: gzip module cannot write large files

Initial Comment:
Something like this:

import gzip
fin = open("/dev/urandom", "rb")
fout = gzip.GzipFile("out", "wb")
for i in range(4500): fout.write(fin.read(1024*1024))
fout.close()

will result in an error like:

Exception 'long int too large to convert to int' raised
of class 'exceptions.OverflowError':
...
  File "/usr/local/lib/python2.2/gzip.py", line 253, in
close
    write32(self.fileobj, self.size)
  File "/usr/local/lib/python2.2/gzip.py", line 19, in
write32
    output.write(struct.pack("<l", value))

Tested in python 2.2.1


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

>Comment By: Brett Cannon (bcannon)
Date: 2003-05-28 18:20

Message:
Logged In: YES 
user_id=357491

>From what I can gather from cvs log this was not backported.  Should it be?

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

Comment By: Steven Taschuk (staschuk)
Date: 2003-03-30 10:42

Message:
Logged In: YES 
user_id=666873

Current CVS has a fix for this, as of revision 1.37 (part of 2.3a1).

See patch 618135: http://www.python.org/sf/618135.

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

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