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 <1622623926.95.0.67138381641.issue44022@roundup.psfhosted.org>
In-reply-to
Content
The test added for this bug is insufficient to verify the fix.  If I revert the Lib/http/client.py 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/test_httplib.py", line 1189, in test_overflowing_header_limit_after_100
    resp.begin()
  File "/tmp/cpython/Lib/http/client.py", line 308, in begin
    version, status, reason = self._read_status()
  File "/tmp/cpython/Lib/http/client.py", 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/test_httplib.py", line 1189, in test_overflowing_header_limit_after_100
    resp.begin()
  File "/tmp/cpython/Lib/http/client.py", line 321, in begin
    skipped_headers = _read_headers(self.fp)
  File "/tmp/cpython/Lib/http/client.py", 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.
History
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: <1622623926.95.0.67138381641.issue44022@roundup.psfhosted.org>
2021-06-02 08:52:06mgornylinkissue44022 messages
2021-06-02 08:52:06mgornycreate