projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc5cc0d
)
explicating the cause of LookupError with a better comment
author
Max Countryman
<max.countryman@gmail.com>
Mon, 12 Mar 2012 02:22:29 +0000
(22:22 -0400)
committer
Max Countryman
<max.countryman@gmail.com>
Mon, 12 Mar 2012 02:22:29 +0000
(22:22 -0400)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index 4bccb1e317f89c9c5d0cf248005479721d99ea3d..fa06948a7bae116dfe592265a489fd5a2cfc9dad 100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-789,7
+789,10
@@
class Response(object):
try:
content = str(self.content, encoding, errors='replace')
except LookupError:
- # try blindly encoding
+ # 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