This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mgorny
Recipients christian.heimes, gen-xu, gregory.p.smith, leveryd, lukasz.langa, mgorny, miss-islington, ned.deily
Date 2021-06-02.08:52:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The test added for this bug is insufficient to verify the fix.  If I revert the Lib/http/ change, the test still passes.  This is because a subclass of client.HTTPException is still raised.

If I add an explicit begin() call to trigger the exception, then without the fix I get:

  File "/tmp/cpython/Lib/test/", line 1189, in test_overflowing_header_limit_after_100
  File "/tmp/cpython/Lib/http/", line 308, in begin
    version, status, reason = self._read_status()
  File "/tmp/cpython/Lib/http/", line 277, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

With the fix, I get (correctly):

test test_httplib failed -- Traceback (most recent call last):
  File "/tmp/cpython/Lib/test/", line 1189, in test_overflowing_header_limit_after_100
  File "/tmp/cpython/Lib/http/", line 321, in begin
    skipped_headers = _read_headers(self.fp)
  File "/tmp/cpython/Lib/http/", line 218, in _read_headers
    raise HTTPException("got more than %d headers" % _MAXHEADERS)
http.client.HTTPException: got more than 100 headers

However, the test considers both exceptions to match.
Date User Action Args
2021-06-02 08:52:07mgornysetrecipients: + mgorny, gregory.p.smith, christian.heimes, ned.deily, lukasz.langa, miss-islington, leveryd, gen-xu
2021-06-02 08:52:06mgornysetmessageid: <>
2021-06-02 08:52:06mgornylinkissue44022 messages
2021-06-02 08:52:06mgornycreate