From 2e1086f5b4fe1caf507abfb6cd2ac0c2ad420e26 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Mon, 5 Sep 2016 14:17:46 -0600 Subject: [PATCH] adding comment --- requests/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requests/models.py b/requests/models.py index acde9e1b..0f91b64e 100644 --- a/requests/models.py +++ b/requests/models.py @@ -848,6 +848,10 @@ class Response(object): 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: