Force encoding of text retrieval functions to use utf-8.

Closes #207
This commit is contained in:
Rapptz
2016-05-10 19:51:59 -04:00
parent 1e175f2ab3
commit 0c8d5ee863
3 changed files with 19 additions and 19 deletions

View File

@ -208,10 +208,10 @@ def _verify_successful_response(response):
message = None
text = None
if response.headers['content-type'] == 'application/json':
data = yield from response.json()
data = yield from response.json(encoding='utf-8')
message = data.get('message')
else:
text = yield from response.text()
text = yield from response.text(encoding='utf-8')
if code == 403:
raise Forbidden(response, message, text)