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

2017-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This may be related to issue18876 or issue20082. -- ___ Python tracker ___ ___ Python-bugs-list

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

2017-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem is that seek() doesn't work properly with files opened in append mode. with open('file', 'ab') as f: f.write(b'abcd') f.seek(0) f.write(b'efgh') f.flush() with open('file', 'rb') as f: print(f.read()) The result is b'abcdefg

[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 file). It's not clear to

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

2017-11-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Py

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

2017-06-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks a duplicate of issue29094. -- status: open -> pending superseder: -> Regression in zipfile writing in 2.7.13 ___ Python tracker __

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

2017-04-30 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[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 to open and show the file list, but files inside l