diff --git a/README.rst b/README.rst index ad88b42d..7ea6ab64 100644 --- a/README.rst +++ b/README.rst @@ -73,4 +73,4 @@ Contribute #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_. .. _`the repository`: http://github.com/kennethreitz/requests -.. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS +.. _AUTHORS: https://github.com/kennethreitz/requests/blob/develop/AUTHORS.rst diff --git a/requests/models.py b/requests/models.py index d301a001..ac1a9e2f 100644 --- a/requests/models.py +++ b/requests/models.py @@ -800,6 +800,12 @@ class Response(object): # Decode unicode from given encoding. try: content = str(self.content, encoding, errors='replace') + except LookupError: + # 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 diff --git a/requests/packages/oreos/monkeys.py b/requests/packages/oreos/monkeys.py index 72ce68d3..2cf90163 100644 --- a/requests/packages/oreos/monkeys.py +++ b/requests/packages/oreos/monkeys.py @@ -255,7 +255,7 @@ class CookieError(Exception): # _RFC2965Forbidden = "[]:{}=" _LegalChars = ( string.ascii_letters + string.digits + - "!#$%&'*+-.^_`|~_" + _RFC2965Forbidden ) + "!#$%&'*+-.^_`|~_@" + _RFC2965Forbidden ) _Translator = { '\000' : '\\000', '\001' : '\\001', '\002' : '\\002', '\003' : '\\003', '\004' : '\\004', '\005' : '\\005',