[issue24301] gzip module failing to decompress valid compressed file

2021-12-31 Thread Ruben Vorderman
Ruben Vorderman added the comment: ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue24301] gzip module failing to decompress valid compressed file

2021-11-29 Thread Ruben Vorderman
Change by Ruben Vorderman : -- keywords: +patch pull_requests: +28076 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29847 ___ Python tracker ___

[issue24301] gzip module failing to decompress valid compressed file

2021-11-29 Thread Ruben Vorderman
Ruben Vorderman added the comment: Whoops. Sorry, I spoke before my turn. If gzip implements it, it seems only logical that python's *gzip* module should too. I believe it can be fixed quite easily. The code should raise a warning though. I will make a PR. -- __

[issue24301] gzip module failing to decompress valid compressed file

2021-11-29 Thread Ruben Vorderman
Ruben Vorderman added the comment: >From the spec: https://datatracker.ietf.org/doc/html/rfc1952 2.2. File format A gzip file consists of a series of "members" (compressed data sets). The format of each member is specified in the following section. The members simply

[issue24301] gzip module failing to decompress valid compressed file

2021-11-27 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11: >>> from gzip import GzipFile >>> from io import BytesIO >>> file = BytesIO() >>> with GzipFile(fileobj=file, mode="wb") as z: ... z.write(b"data") ... 4 >>> file.write(b"garbage") 7 >>> file.seek(0) 0 >>> GzipFile(fileobj=file).read() T

[issue24301] gzip module failing to decompress valid compressed file

2015-06-15 Thread Martin Panter
Martin Panter added the comment: Just noticed in my previous message I mentioned Issue 1508475 a few times when I meant to say Issue 1159051. In Python 3.5, a workaround is not so easy because we would need to access the internal buffer of a BufferedReader. One potential workaround is to use r

[issue24301] gzip module failing to decompress valid compressed file

2015-06-14 Thread Nick Czeczulin
Nick Czeczulin added the comment: The spec allows for multi-member files. Some libraries and utilities seem to solve this problem (incorrectly?) by simply ignoring everything past the first member -- even when valid (e.g., DotNetZip, 7-Zip) For 2.7 and 3.4, the data that has been decompressed

[issue24301] gzip module failing to decompress valid compressed file

2015-05-27 Thread Martin Panter
Martin Panter added the comment: I suspect Eric’s file has non-zero, non-gzip garbage bytes appended to the end of it. Assuming I am right, here is way to reproduce that scenario: >>> from gzip import GzipFile >>> from io import BytesIO >>> file = BytesIO() >>> with GzipFile(fileobj=file, mode=

[issue24301] gzip module failing to decompress valid compressed file

2015-05-27 Thread Ned Deily
Ned Deily added the comment: Can you add a public copy of a file that fails this way? There are several open issues with gzip, like Issue1159051, that might cover this but it's hard to know for sure without a test case. -- nosy: +ned.deily type: crash ->

[issue24301] gzip module failing to decompress valid compressed file

2015-05-27 Thread Eric Gorr
New submission from Eric Gorr: I have a file whose first four bytes are 1F 8B 08 00 and if I use gunzip from the command line, it outputs: gzip: zImage_extracted.gz: decompression OK, trailing garbage ignored and correctly decompresses the file. However, if I use the gzip module to read and d