diff options
author | Donald Stufft <donald@stufft.io> | 2017-03-18 14:51:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-18 14:51:13 -0400 |
commit | b005a9bb84c1903bf438d57c33938e67e8bb2b29 (patch) | |
tree | 696af7e9139f3a9aa13d202a37c0c7d1530a0125 /pip/_vendor/requests/packages/urllib3/exceptions.py | |
parent | ac55737e7a1c5d077f8394145ffcf6bcec249a57 (diff) | |
download | pip-b005a9bb84c1903bf438d57c33938e67e8bb2b29.tar.gz |
Upgrade setuptools, appdirs, cachecontrol, distro, ipaddress, pyparsing, and requests (#4342)
* Upgrade setuptools to 34.3.2
* Upgrade appdirs to 1.4.3
* Upgrade CacheControl to 0.12.1
* Upgrade distro to 1.0.2
* Upgrade ipaddress to 1.0.18
* Upgrade pyparsing to 2.2.0
* Upgrade requests to 2.13.0
* Remove patching of progress
* Don't translate imports that would be syntax errors
* Patch pkg_resources to handle packaging correctly
Diffstat (limited to 'pip/_vendor/requests/packages/urllib3/exceptions.py')
-rw-r--r-- | pip/_vendor/requests/packages/urllib3/exceptions.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pip/_vendor/requests/packages/urllib3/exceptions.py b/pip/_vendor/requests/packages/urllib3/exceptions.py index f2e65917b..6c4be5810 100644 --- a/pip/_vendor/requests/packages/urllib3/exceptions.py +++ b/pip/_vendor/requests/packages/urllib3/exceptions.py @@ -1,4 +1,7 @@ from __future__ import absolute_import +from .packages.six.moves.http_client import ( + IncompleteRead as httplib_IncompleteRead +) # Base Exceptions @@ -193,6 +196,35 @@ class ResponseNotChunked(ProtocolError, ValueError): pass +class BodyNotHttplibCompatible(HTTPError): + """ + Body should be httplib.HTTPResponse like (have an fp attribute which + returns raw chunks) for read_chunked(). + """ + pass + + +class IncompleteRead(HTTPError, httplib_IncompleteRead): + """ + Response length doesn't match expected Content-Length + + Subclass of http_client.IncompleteRead to allow int value + for `partial` to avoid creating large objects on streamed + reads. + """ + def __init__(self, partial, expected): + super(IncompleteRead, self).__init__(partial, expected) + + def __repr__(self): + return ('IncompleteRead(%i bytes read, ' + '%i more expected)' % (self.partial, self.expected)) + + +class InvalidHeader(HTTPError): + "The header provided was somehow invalid." + pass + + class ProxySchemeUnknown(AssertionError, ValueError): "ProxyManager does not support the supplied scheme" # TODO(t-8ch): Stop inheriting from AssertionError in v2.0. @@ -207,3 +239,8 @@ class HeaderParsingError(HTTPError): def __init__(self, defects, unparsed_data): message = '%s, unparsed data: %r' % (defects or 'Unknown', unparsed_data) super(HeaderParsingError, self).__init__(message) + + +class UnrewindableBodyError(HTTPError): + "urllib3 encountered an error when trying to rewind a body" + pass |