This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author osuchw
Recipients
Date 2003-11-25.20:09:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When dealing with large zipped files I've noticed that
ZipInfo instance was reporting incorrect file size.
I could reproduce the error by:

txtfile = file('bigone.txt','w')
for i in xrange(10**8):
    txtfile.write('%-9s Hello World\n'%i) 
txtfile.close()
os.stat('bigone.txt').st_size
2300000000L

Now I zip the bugger and:
z = zipfile.ZipFile(file('bigone.zip','r'))
fi = z.infolist()[0]
fi.file_size
-1994967296

After changing zipfile.py on line 26 from:
structCentralDir = "<4s4B4H3l5HLl"
to:
structCentralDir = "<4s4B4H3L5HLl"

I get:
z = zipfile.ZipFile(file('bigone.zip','r'))
fi = z.infolist()[0]
fi.file_size
2300000000L

Sorry for a digression but it would be nice to have
something similar to a module from Twisted distribution
(twisted.python.zipstream) in standard library.
The above module allows to read a zipped file in chunks
using iterator.  It would help tremendously when
dealing with large files.
History
Date User Action Args
2008-01-20 09:56:35adminlinkissue849218 messages
2008-01-20 09:56:35admincreate