]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 28 Jan 2025 12:00:54 +0000 (13:00 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Jan 2025 12:00:54 +0000 (12:00 +0000)
commitbf6c256a643b7066e922fb3a7e44aa3e006a29f3
tree8b06da952734fc01159db08b31b7fe18100170cc
parent332426b4af632294d0be6f01b42b0fb61f79378f
[3.13] gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()` (GH-128270) (#129395)

gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()` (GH-128270)

The parameter `amt` of `HTTPResponse.read()`, which could be a negative integer,
has not been handled before and led to waiting for the connection to close
for `keep-alive connections`. Now, this has been fixed, and passing negative values
to `HTTPResponse().read()` works the same as passing `None` value.
(cherry picked from commit 4d0d24f6e3dff2864007c3cfd1cf7d49c6ee5317)

Co-authored-by: Yury Manushkin <manushkin@gmail.com>
Lib/http/client.py
Lib/test/test_httplib.py
Misc/NEWS.d/next/Library/2024-12-26-11-00-03.gh-issue-112064.mCcw3B.rst [new file with mode: 0644]