python: Use requests.Response.text instead of decoding content.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-29 16:13:37 -07:00
committed by Tim Abbott
parent 5fb667cf9e
commit 1802a50cc9
3 changed files with 5 additions and 6 deletions

View File

@@ -310,7 +310,7 @@ def do_rest_call(base_url: str,
"%(response)s\"",
{'message_url': get_message_url(event),
'status_code': response.status_code,
'response': response.content.decode()})
'response': response.text})
failure_message = f"Third party responded with {response.status_code}"
fail_with_message(event, failure_message)
notify_bot_owner(event, response.status_code, response.content)