str is redefined in compat module, but was not imported
authorHonza Javorek <honza@javorek.net>
Thu, 23 Feb 2012 22:51:59 +0000 (23:51 +0100)
committerHonza Javorek <honza@javorek.net>
Thu, 23 Feb 2012 22:51:59 +0000 (23:51 +0100)
requests/utils.py

index e8172dee0e5dbf3ce07dcefa76af654046c4dea9..09bb77c21310144dfdc822aba5bc5be31cf16088 100644 (file)
@@ -19,7 +19,7 @@ from netrc import netrc, NetrcParseError
 
 from .compat import parse_http_list as _parse_list_header
 from .compat import quote, cookielib, SimpleCookie, is_py2, urlparse
-from .compat import basestring, bytes
+from .compat import basestring, bytes, str
 
 
 NETRC_FILES = ('.netrc', '_netrc')
@@ -374,7 +374,7 @@ def get_unicode_from_response(r):
 
     # Fall back:
     try:
-        return unicode(r.content, encoding, errors='replace')
+        return str(r.content, encoding, errors='replace')
     except TypeError:
         return r.content