]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()...
authorYury Manushkin <manushkin@gmail.com>
Tue, 28 Jan 2025 11:37:32 +0000 (12:37 +0100)
committerGitHub <noreply@github.com>
Tue, 28 Jan 2025 11:37:32 +0000 (11:37 +0000)
commit4d0d24f6e3dff2864007c3cfd1cf7d49c6ee5317
tree5cee215bfcf0c5aada56ac1bb3b879061f16e1cb
parent8e57877e3f43e80762196f6869526d0c1585783a
gh-112064: Fix incorrect handling of negative read sizes in `HTTPResponse.read()` (#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.
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]