Message284172
In Python 2.7.13, using zipfile.ZipFile to write into a file with some initial preamble produces a zip file that cannot be read again by some zip implementations.
Our use case is using pex (https://github.com/pantsbuild/pex) which writes a zip that begins with a shebang, and later attempting to manipulate that using Go's standard archive/zip package. In 2.7.12 that works OK, but in 2.7.13 the .pex file is rejected on reading. Linux's command-line unzip tool will read the archive, but issues a warning ("4 extra bytes at beginning or within zipfile") which wasn't present previously.
zipfile.ZipFile does read the files OK.
I assume this is related to https://bugs.python.org/issue26293 since that's the most obvious zipfile change in 2.7.13. It's pretty easy to reproduce using the example in that issue:
from zipfile import ZipFile
with open('a.zip', 'wb') as base:
base.write(b'old\n')
with ZipFile(base, 'a') as myzip:
myzip.write('eggs.txt')
unzip -t a.zip
Archive: a.zip
warning [a.zip]: 4 extra bytes at beginning or within zipfile
(attempting to process anyway)
... |
|
Date |
User |
Action |
Args |
2016-12-28 13:26:32 | Peter Ebden | set | recipients:
+ Peter Ebden |
2016-12-28 13:26:31 | Peter Ebden | set | messageid: <1482931591.96.0.8795611166.issue29094@psf.upfronthosting.co.za> |
2016-12-28 13:26:31 | Peter Ebden | link | issue29094 messages |
2016-12-28 13:26:31 | Peter Ebden | create | |
|