[issue1526] DeprecationWarning in zipfile.py while zipping 113000 files

Alan McIntyre report at bugs.python.org
Sat Jan 5 11:41:41 CET 2008


Alan McIntyre added the comment:

The reported warning was being produced when writing the "end of central
directory record", in ZipFile.close().

Based on a little experiment with 70k test text files, the default
archiver in OS X appears to just use the number of files mod 64k in the
end of central directory record. I tweaked the ZipFile close() method to
do this, and the resulting ZIP file appears to work just fine, both with
the OS X archiver and with ZipFile (without ZIP64 enabled).  

There's a blurb in the ZIP format description about this sort of thing:
"If an archive is in ZIP64 format and the value in this field is 0xFFFF,
the size will be in the corresponding 8 byte zip64 end of central
directory field."  I don't know if that means "the right thing" is to
switch the archive to ZIP64 format if more than 64k files are added, though.

If I have time I'll go look at some other open source ZIP
implementations, but I won't swear I'll ever get around to it. :)

----------
nosy: +alanmcintyre

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1526>
__________________________________


More information about the Python-bugs-list mailing list