get_unicode_from_response returned str instead of unicode
authorHonza Javorek <honza@javorek.net>
Thu, 23 Feb 2012 16:28:56 +0000 (17:28 +0100)
committerHonza Javorek <honza@javorek.net>
Thu, 23 Feb 2012 16:28:56 +0000 (17:28 +0100)
requests/utils.py

index 106c7d8..e8172de 100644 (file)
@@ -374,7 +374,7 @@ def get_unicode_from_response(r):
 
     # Fall back:
     try:
-        return str(r.content, encoding, errors='replace')
+        return unicode(r.content, encoding, errors='replace')
     except TypeError:
         return r.content