You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 515, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 502, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 612, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 616, in urlopen
**response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 467, in from_httplib
**response_kw)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 155, in __init__
self.length_remaining = self._init_length(request_method)
File "/usr/lib/python2.7/dist-packages/urllib3/response.py", line 229, in _init_length
"unmatching values (%s)" % length)
exception.type: InvalidHeader
exception.value: Content-Length contained multiple unmatching values (0, 9929)
Thanks for opening this issue, @piotrjurkiewicz! It does seem like we should try to wrap this in the Requests exception namespace. It looks like the HTTPError funnel in adapters.py raises everything it doesn't recognize here. There are actually a few newer exceptions from urllib3 I'm not sure we're accounting for in this case.
I'm not positive what the best approach is since we'll end up with an increasingly growing exception conditional list if urllib3 continues to add more exceptions. Alternatively, we could return a more generic wrapper exception but that'll likely make debugging harder. I'm sure one of the other maintainers will have a leaning on which direction to go here.
In some cases
urlib3.exceptions.InvalidHeader
exception is not being replaced withrequests.InvalidHeader
and leaks.Expected Result
Raise
requests.exceptions.InvalidHeader(RequestException, ValueError)
.Actual Result
urllib3.exceptions.InvalidHeader
is raised.Stack trace
System Information
The text was updated successfully, but these errors were encountered: