[issue30213] ZipFile from 'a'ppend-mode file generates invalid zip

2017-12-03 Thread BoppreH
BoppreH added the comment: I'm not sure this is a duplicate of issue29094. That issue includes random data at the start of the file, while this issue uses the 'ab' mode solely for a creating the file if it doesn't exist (and thus is either empty or already a valid zip f

[issue30213] ZipFile from 'a'ppend-mode file generates invalid zip

2017-04-29 Thread BoppreH
New submission from BoppreH: I may be misunderstanding file modes or the `zipfile` library, but from zipfile import ZipFile ZipFile(open('a.zip', 'ab'), 'a').writestr('f.txt', 'z') unexpectedly creates an invalid zip file. 7zip is able