From 7586fdf1e839a764e9ce19b8c457dbd9367a5c25 Mon Sep 17 00:00:00 2001 From: Alexandre Morignot Date: Mon, 7 Sep 2020 13:21:38 +0200 Subject: [PATCH] Bump canonicaljson to version 1.4.0 (#8262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The version 1.3.0 has a bug with unicode charecters: ``` >>> from canonicaljson import encode_pretty_printed_json >>> encode_pretty_printed_json({'a': 'à'}) Traceback (most recent call last): File "", line 1, in File "/home/erdnaxeli/.pyenv/versions/3.6.7/lib/python3.6/site-packages/canonicaljson.py", line 96, in encode_pretty_printed_json return _pretty_encoder.encode(json_object).encode("ascii") UnicodeEncodeError: 'ascii' codec can't encode character '\xe0' in position 12: ordinal not in range(128) ``` Signed-off-by: Alexandre Morignot Co-authored-by: Alexandre Morignot --- changelog.d/8262.bugfix | 1 + synapse/python_dependencies.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/8262.bugfix diff --git a/changelog.d/8262.bugfix b/changelog.d/8262.bugfix new file mode 100644 index 000000000000..2b84927de3ee --- /dev/null +++ b/changelog.d/8262.bugfix @@ -0,0 +1 @@ +Upgrade canonicaljson to version 1.4.0 to fix an unicode encoding issue. diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index 2d995ec456a5..ff0c67228bea 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -43,7 +43,7 @@ "jsonschema>=2.5.1", "frozendict>=1", "unpaddedbase64>=1.1.0", - "canonicaljson>=1.3.0", + "canonicaljson>=1.4.0", # we use the type definitions added in signedjson 1.1. "signedjson>=1.1.0", "pynacl>=1.2.1",