Skip to content

Commit

Permalink
accept an errors parameter for text encoding ClientResponses
Browse files Browse the repository at this point in the history
  • Loading branch information
bmuller committed Jan 16, 2017
1 parent 79d7568 commit 01ec819
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,15 +741,15 @@ def _get_encoding(self):
return encoding

@asyncio.coroutine
def text(self, encoding=None):
def text(self, encoding=None, errors='strict'):
"""Read response payload and decode."""
if self._content is None:
yield from self.read()

if encoding is None:
encoding = self._get_encoding()

return self._content.decode(encoding)
return self._content.decode(encoding, errors)

@asyncio.coroutine
def json(self, *, encoding=None, loads=json.loads):
Expand Down

0 comments on commit 01ec819

Please sign in to comment.