Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
adding comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nateprewitt committed Sep 5, 2016
1 parent cd056cd commit 2e1086f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions requests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,10 @@ def raise_for_status(self):

http_error_msg = ''
if isinstance(self.reason, bytes):
# We attempt to decode utf-8 first because some servers
# choose to localize their reason strings. If the string
# isn't utf-8, we fall back to iso-8859-1 for all other
# encodings. (See PR #3538)
try:
reason = self.reason.decode('utf-8')
except UnicodeDecodeError:
Expand Down

0 comments on commit 2e1086f

Please sign in to comment.