gh-69152: Add _proxy_response_headers attribute to HTTPConnection by nametkin · Pull Request #26152 · python/cpython (original) (raw)
@orsenthil, thanks for the review!
Regarding condition if not line
. It seems to me that this is now a useless part of the code. Because the only variant of the line value in which this condition will be true, if I'm not mistaken, is line = b"
(because the method readline
can't return None
or just an empty string). And for the equality of line to the value of b'', we check a little below.
I looked at the history, these lines were added when there was no equality check for the empty binary object below. That is, at some point they made sense, but after this commit, they ceased to be necessary.
But we can add this check to the _read_headers method as a precaution. Do you think it should be done?