mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Merge branch 'unicode_missing_self' of https://github.com/Telofy/requests into develop
This commit is contained in:
+1
-8
@@ -771,17 +771,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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user