Serhiy Storchaka added the comment:
It is common to prepend some data (e.g. self-extractor exacutable) to ZIP file,
but it is not common to append data to ZIP file. In this case all appended data
is zero bytes, and it looks as particularity of particular software rather than
common case. Thus
Serhiy Storchaka added the comment:
not_working.zip has 85972 extra null bytes at the end. This doesn't look as
common ZIP file, and adding support such files can be considered as new feature
(if it is worth to do at all). How did you get this file Yasar?
--
type: behavior -
Alexei Romanov added the comment:
7z archiver could extract this ZIP archive without any problems:
~/tmp $ 7z x not_working.zip
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_US.utf8,Utf16=on,HugeFiles=on,4 CPUs)
Processing archive:
Yasar L. Ahmed added the comment:
@Serhiy These files are inside another Zip-bundle exported from a commercial
control software for chromatography (UNICORN 6+ by GE Healthcare). Some of the
other Zip-Files in the bundle work fine but some (like this one) don't.
I'm writing a script to
Serhiy Storchaka added the comment:
Would it help to remove the offending bytes and then feed the bytes-object to
ZipFile?
Yes, it will.
import zipfile, struct, io
with open('not_working.zip', 'rb') as f:
data = f.read()
i = data.rindex(b'PK\5\6') + 22
i += struct.unpack('H', data[i-2:
Changes by Ronald Oussoren ronaldousso...@mac.com:
--
nosy: +ronaldoussoren
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24621
___
___
Serhiy Storchaka added the comment:
unzip can't proceed this file too.
$ unzip -v not_working.zip
Archive: not_working.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24621
___
New submission from Yasar Luqman Ahmed:
I have a zip-file that can be opened/extracted with 7zip but gives an error
when I try work with it in python:
Py2 (2.7.3 / Linux/Debian7):
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.7/zipfile.py, line 714,