From 665dd9f7f8db2f8d38f454d4d5b96efcf163a5db Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 9 Sep 2019 11:35:56 +0100 Subject: Ensure the password reset template is correctly converted to binary Regardless of the Python version --- synapse/rest/client/v2_alpha/account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py index 32770a4a95..20e1e01592 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py @@ -17,6 +17,7 @@ import logging import re +from six import ensure_binary from six.moves import http_client import jinja2 @@ -295,7 +296,7 @@ class PasswordResetSubmitTokenServlet(RestServlet): ) request.setResponseCode(e.code) - request.write(html.encode('utf-8')) + request.write(ensure_binary(html)) finish_request(request) defer.returnValue(None) -- cgit 1.5.1