Skip to content
Myr

Merge pull request #1816 from daftshady/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Re-raise DecodeError

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 0eb6dc3, aad8287 · Browse files · 2 files+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−1 removed

  • other:+8 added−1 removed

2 files+8 added−1 removed

modified:requests/exceptions.py+4 added
59 unmodified lines
606162class ChunkedEncodingError(RequestException):63 """The server declared chunked encoding but sent an invalid chunk."""646566class ContentDecodingError(RequestException):67 """Failed to decode response content"""
modified:requests/models.py+4 added-1 removed
18 unmodified lines
19from .cookies import cookiejar_from_dict, get_cookie_header20from .packages.urllib3.fields import RequestField21from .packages.urllib3.filepost import encode_multipart_formdata22from .packages.urllib3.util import parse_url23from .packages.urllib3.exceptions import DecodeError24from .exceptions import (25 HTTPError, RequestException, MissingSchema, InvalidURL,25 ChunkedEncodingError)26 ChunkedEncodingError, ContentDecodingError)27from .utils import (28 guess_filename, get_auth_from_url, requote_uri,29 stream_decode_response_unicode, to_key_val_list, parse_header_links,30 iter_slices, guess_json_utf, super_len, to_native_string)
585 unmodified lines
616 decode_content=True):617 yield chunk618 except IncompleteRead as e:619 raise ChunkedEncodingError(e)620 except DecodeError as e:621 raise ContentDecodingError(e)622 except AttributeError:623 # Standard file-like object.624 while True:625 chunk = self.raw.read(chunk_size)
151 unmodified lines