Skip to content

Commit 1cde995

Browse files
committed
gh-160310: Use len(data) for the first gzip chunk size
1 parent d8913a9 commit 1cde995

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎Lib/gzip.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,7 @@ def decompress(data):
685685
fp = io.BytesIO(data)
686686
# There is usually a single member: the first chunk is all of the data,
687687
# to decompress it in one go.
688-
chunk_size = fp.seek(0, io.SEEK_END)
689-
fp.seek(0)
688+
chunk_size = len(data)
690689
while True:
691690
if _read_gzip_header(fp) is None:
692691
return b"".join(decompressed_members)

0 commit comments

Comments
 (0)