Message79408
I believe I have hit this bug. With Python 2.6.1 in a Gentoo Linux
64 bits.
This code:
from zipfile import ZipFile
inzip = ZipFile('Document.odt')
outzip = ZipFile('out.zip', 'w')
for f in inzip.infolist():
if f.filename != 'content.xml':
print f.filename, '(CRC: %s)' % f.CRC
outzip.writestr(f, inzip.read(f.filename))
outzip.close()
Produces this output:
...
styles.xml (CRC: 3930581528)
test_odt.py:10: DeprecationWarning: 'l' format requires -2147483648 <=
number <= 2147483647
outzip.writestr(f, inzip.read(f.filename))
...
The CRC is not a 32bits signed, and then the module struct complains,
here:
zipfile.py:1098
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
Apparently 'struct.pack' expects 'zinfo.CRC' to be a 32 signed it,
which is not.
I can attach the 'Document.odt' file if you want. |
|
Date |
User |
Action |
Args |
2009-01-08 12:13:48 | jdavid.ibp@gmail.com | set | recipients:
+ jdavid.ibp@gmail.com, gvanrossum, arigo, facundobatista, gregory.p.smith, jcea, tlesher, mbecker |
2009-01-08 12:13:48 | jdavid.ibp@gmail.com | set | messageid: <1231416828.32.0.321438355884.issue1202@psf.upfronthosting.co.za> |
2009-01-08 12:13:47 | jdavid.ibp@gmail.com | link | issue1202 messages |
2009-01-08 12:13:46 | jdavid.ibp@gmail.com | create | |
|