From: Max Countryman Date: Mon, 12 Mar 2012 02:22:29 +0000 (-0400) Subject: explicating the cause of LookupError with a better comment X-Git-Tag: v0.11.1~11^2~4^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83a9f2c7407347a4e1e148e2a1bea4b47e1543c0;p=services%2Fpython-requests.git explicating the cause of LookupError with a better comment --- diff --git a/requests/models.py b/requests/models.py index 4bccb1e..fa06948 100644 --- 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