don't double decode
authorKenneth Reitz <me@kennethreitz.com>
Sun, 22 Jan 2012 03:56:53 +0000 (22:56 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Sun, 22 Jan 2012 03:56:53 +0000 (22:56 -0500)
requests/models.py

index f001c08..8a293cb 100644 (file)
@@ -752,7 +752,8 @@ class Response(object):
 
         # Try to fall back:
         try:
-            content = unicode(content, encoding, errors='replace')
+            if not content:
+                content = unicode(content, encoding, errors='replace')
         except UnicodeError, TypeError:
             pass