summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-08-29 16:50:10 +0100
committerGitHub <noreply@github.com>2019-08-29 16:50:10 +0100
commit84e695f506faf54982b9e19dceb9c02acffad95f (patch)
tree82aeac0653c08b1bd7549b62391ff334458fcff6 /synapse
parentMerge pull request #5815 from matrix-org/babolivier/dinsic-message-retention (diff)
parentBump requirement for six to 1.12 (diff)
downloadsynapse-github/dinsic.tar.xz
Merge pull request #5932 from matrix-org/babolivier/account_validity_template_encode dinsic_2019-08-30 github/dinsic dinsic
Fix encoding for account validity HTML files on Python 2
Diffstat (limited to 'synapse')
-rw-r--r--synapse/python_dependencies.py2
-rw-r--r--synapse/rest/client/v2_alpha/account_validity.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py
index 7dfa78dadb..9692f0bf75 100644
--- a/synapse/python_dependencies.py
+++ b/synapse/python_dependencies.py
@@ -67,7 +67,7 @@ REQUIREMENTS = [
     "pymacaroons>=0.13.0",
     "msgpack>=0.5.0",
     "phonenumbers>=8.2.0",
-    "six>=1.10",
+    "six>=1.12",
     # prometheus_client 0.4.0 changed the format of counter metrics
     # (cf https://github.com/matrix-org/synapse/issues/4001)
     "prometheus_client>=0.0.18,<0.4.0",
diff --git a/synapse/rest/client/v2_alpha/account_validity.py b/synapse/rest/client/v2_alpha/account_validity.py
index 8091b78285..98f7c60016 100644
--- a/synapse/rest/client/v2_alpha/account_validity.py
+++ b/synapse/rest/client/v2_alpha/account_validity.py
@@ -15,6 +15,8 @@
 
 import logging
 
+from six import ensure_binary
+
 from twisted.internet import defer
 
 from synapse.api.errors import AuthError, SynapseError
@@ -63,7 +65,7 @@ class AccountValidityRenewServlet(RestServlet):
         request.setResponseCode(status_code)
         request.setHeader(b"Content-Type", b"text/html; charset=utf-8")
         request.setHeader(b"Content-Length", b"%d" % (len(response),))
-        request.write(response.encode("utf8"))
+        request.write(ensure_binary(response))
         finish_request(request)
         defer.returnValue(None)