Skip to content
Myr

Merge pull request #867 from mattswe/patch-1

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

Handle encoding of `None` when decoding unicode

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 1cb31f2, 38aced9 · Browse files · 1 file+3 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+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:requests/models.py+3 added-1 removed
826 unmodified lines
827828 # Decode unicode from given encoding.829 try:830 content = str(self.content, encoding, errors='replace')831 except LookupError:831 except (LookupError, TypeError):832 # A LookupError is raised if the encoding was not found which could833 # indicate a misspelling or similar mistake.834 #835 # A TypeError can be raised if encoding is None836 #837 # So we try blindly encoding.838 content = str(self.content, errors='replace')839840 return content
52 unmodified lines