Skip to content
Myr

Merge pull request #2598 from Lukasa/not-poor

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

Partially revert ab84f9be5740d4649d734e73b84f17f85e52ffc9

authored by Ian Cordasco · committed by Ian Cordasco · parents c3c4c96, 553907a · Browse files · 1 file+7 added−4 removed
This commit

State

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

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:requests/models.py+7 added-4 removed
28 unmodified lines
29 stream_decode_response_unicode, to_key_val_list, parse_header_links,30 iter_slices, guess_json_utf, super_len, to_native_string)31from .compat import (32 cookielib, urlunparse, urlsplit, urlencode, str, bytes, StringIO,33 is_py2, chardet, json, builtin_str, basestring)33 is_py2, chardet, builtin_str, basestring)34from .compat import json as complexjson35from .status_codes import codes3637#: The set of HTTP status codes that indicate an automatically38#: processable redirect.
376 unmodified lines
415 length = None416417 if json is not None:418 content_type = 'application/json'418 body = json.dumps(json)419 body = complexjson.dumps(json)420421 is_stream = all([422 hasattr(data, '__iter__'),423 not isinstance(data, (basestring, list, tuple, dict))
368 unmodified lines
792 # a best guess).793 encoding = guess_json_utf(self.content)794 if encoding is not None:795 try:795 return json.loads(self.content.decode(encoding), **kwargs)796 return complexjson.loads(797 self.content.decode(encoding), **kwargs798 )799 except UnicodeDecodeError:800 # Wrong UTF codec detected; usually because it's not UTF-8801 # but some other 8-bit codec. This is an RFC violation,802 # and the server didn't bother to tell us what codec *was*803 # used.804 pass802 return json.loads(self.text, **kwargs)805 return complexjson.loads(self.text, **kwargs)806807 @property808 def links(self):809 """Returns the parsed header links of the response, if any."""
36 unmodified lines