The `self` was missing again, and I think the two blocks were redundant.
authorTelofy <drescher@retresco.de>
Mon, 30 Jan 2012 11:23:43 +0000 (12:23 +0100)
committerTelofy <drescher@retresco.de>
Mon, 30 Jan 2012 11:23:43 +0000 (12:23 +0100)
requests/models.py

index 7ac85cc..7126f08 100644 (file)
@@ -773,17 +773,10 @@ class Response(object):
 
         # Decode unicode from given encoding.
         try:
-            content = str(self.content, encoding)
+            content = str(self.content, encoding, errors='replace')
         except (UnicodeError, TypeError):
             pass
 
-        # Try to fall back:
-        if not content:
-            try:
-                content = str(content, encoding, errors='replace')
-            except (UnicodeError, TypeError):
-                pass
-
         return content