]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128646: Implement GzipFile.readinto[1]() methods (GH-128647)
authorChris Markiewicz <markiewicz@stanford.edu>
Sat, 8 Mar 2025 03:04:45 +0000 (22:04 -0500)
committerGitHub <noreply@github.com>
Sat, 8 Mar 2025 03:04:45 +0000 (21:04 -0600)
commit72e5b25efb580fb1f0fdfade516be90d90822164
tree64dae27e381d598dec62d62d48c6e35d65bc6a94
parent78790811989ab47319e2ee725e0c435b3cdd21ab
gh-128646: Implement GzipFile.readinto[1]() methods (GH-128647)

The new methods simply delegate to the underlying buffer, much like the existing GzipFile.read[1] methods.  This avoids extra allocations caused by the BufferedIOBase.readinto implementation previously used.

This commit also factors out a common readability check rather than copying it an additional two times.
Lib/gzip.py
Lib/test/test_gzip.py
Misc/NEWS.d/next/Library/2025-01-08-15-14-17.gh-issue-128647.GabglU.rst [new file with mode: 0644]