Michał Górny <[email protected]> added the comment:
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.
----------
nosy: +mgorny
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44022>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com