Merge pull request #477 from maxcountryman/develop

potentially fixes #338
This commit is contained in:
Kenneth Reitz
2012-03-15 18:15:27 -07:00
+6
View File
@@ -800,6 +800,12 @@ class Response(object):
# Decode unicode from given encoding.
try:
content = str(self.content, encoding, errors='replace')
except LookupError:
# A LookupError is raised if the encoding was not found which could
# indicate a misspelling or similar mistake.
#
# So we try blindly encoding.
content = str(self.content, errors='replace')
except (UnicodeError, TypeError):
pass