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 jdavid.ibp@gmail.com
Recipients arigo, facundobatista, gregory.p.smith, gvanrossum, jcea, jdavid.ibp@gmail.com, mbecker, tlesher
Date 2009-01-08.12:13:46
SpamBayes Score 0.00063012243
Marked as misclassified No
Message-id <1231416828.32.0.321438355884.issue1202@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-01-08 12:13:48jdavid.ibp@gmail.comsetrecipients: + jdavid.ibp@gmail.com, gvanrossum, arigo, facundobatista, gregory.p.smith, jcea, tlesher, mbecker
2009-01-08 12:13:48jdavid.ibp@gmail.comsetmessageid: <1231416828.32.0.321438355884.issue1202@psf.upfronthosting.co.za>
2009-01-08 12:13:47jdavid.ibp@gmail.comlinkissue1202 messages
2009-01-08 12:13:46jdavid.ibp@gmail.comcreate