[issue34606] Unable to read zip file with extra

2019-06-25 Thread Andreas Gäer
Andreas Gäer added the comment: I'm a little bit puzzled that this bug is closed as "not a bug" despite the fact that all versions of python allow the user to create "invalid" ZIP files and all version up to 3.7 are able to read those "invalid" files. Currently we're stuck with a lot of

[issue34606] Unable to read zip file with extra

2018-09-12 Thread Kyle Altendorf
Kyle Altendorf added the comment: Vladimir, if compression were the cause wouldn't the extra bytes I added (signature and length) not have any effect? If you've found an issue it seems like it would be a different one than I was triggering. --

[issue34606] Unable to read zip file with extra

2018-09-11 Thread Vladimir Matveev
Vladimir Matveev added the comment: In this particular case looks like a crux of the problem was in the fact that compression encodes extra fields only if either zip64 is set or length of the field is larger than threshold but decompression always tries to decode it. Attached PR switches

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Vladimir Matveev
Change by Vladimir Matveev : -- pull_requests: +8561 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Right, the correct section is 4.5. All integers in ZIP files are unsigned and in the little endian format. -- ___ Python tracker ___

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf
Kyle Altendorf added the comment: Python 3.7 works with 2-byte elements, I managed to find the wrong section in the doc-linked docs. 4.5 Extensible data fields -- 4.5.1 In order to allow different programs and different types of information to

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf
Kyle Altendorf added the comment: Turns out the docs do document this. My apologies. https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT 4.3.11 Archive extra data record: archive extra data signature4 bytes (0x08064b50) extra field length 4

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The value of the extra attribute is not an arbitrary bytes object. It is a sequence of blocks in the following format: 16-bit identifier followed by 16-bit size of the block followed by the specified amount of bytes. Your example creates invalid ZIP file.

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: It's also reproducible on master. git blame tells me this is introduced with feccdb2a249a71be330765be77dee57121866779 (https://bugs.python.org/issue29774) ➜ cpython git:(master) commit feccdb2a249a71be330765be77dee57121866779 Author: Serhiy

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34606] Unable to read zip file with extra

2018-09-07 Thread Kyle Altendorf
New submission from Kyle Altendorf : This was first found over in Twisted tests. We probably aren't too terribly worried about it but I wanted to report here anyways. https://twistedmatrix.com/trac/ticket/9525 Both 3.6 and 3.7 write the same file (sha at the end) based on the script in the