Merge pull request #909 from mjpieters/issue765-json-encodings
authorKenneth Reitz <me@kennethreitz.com>
Sat, 27 Oct 2012 15:02:55 +0000 (08:02 -0700)
committerKenneth Reitz <me@kennethreitz.com>
Sat, 27 Oct 2012 15:02:55 +0000 (08:02 -0700)
Use a JSON-specific encoding detection when no encoding has been specified

1  2 
requests/models.py

index a87a988b48da4dd2f66046244f16faa71db7dc33,06c8a71a3e80b3c618b868081ea383e4860c70d4..f3d7d7682bb0bde2c29661a207fdc24074adb216
@@@ -31,10 -31,11 +31,11 @@@ from .exceptions import 
  from .utils import (
      get_encoding_from_headers, stream_untransfer, guess_filename, requote_uri,
      stream_decode_response_unicode, get_netrc_auth, get_environ_proxies,
-     to_key_val_list, DEFAULT_CA_BUNDLE_PATH, parse_header_links, iter_slices)
+     to_key_val_list, DEFAULT_CA_BUNDLE_PATH, parse_header_links, iter_slices,
+     guess_json_utf)
  from .compat import (
      cookielib, urlparse, urlunparse, urljoin, urlsplit, urlencode, str, bytes,
 -    StringIO, is_py2, chardet, json, builtin_str)
 +    StringIO, is_py2, chardet, json, builtin_str, urldefrag)
  
  REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)
  CONTENT_CHUNK_SIZE = 10 * 1024