Skip to content
Myr

explicating the cause of LookupError with a better comment

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Max Countryman · committed by Max Countryman · parent bc5cc0d · Browse files · 1 file+4 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:requests/models.py+4 added-1 removed
787 unmodified lines
788 # Decode unicode from given encoding.789 try:790 content = str(self.content, encoding, errors='replace')791 except LookupError:792 # try blindly encoding792 # A LookupError is raised if the encoding was not found which could793 # indicate a misspelling or similar mistake.794 #795 # So we try blindly encoding.796 content = str(self.content, errors='replace')797 except (UnicodeError, TypeError):798 pass799
23 unmodified lines