Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b0659a1

Browse files
committed
Merge branch 'master' into develop
2 parents 1800bd4 + 9925f9b commit b0659a1

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Synapse 1.55.2 (2022-03-24)
2+
===========================
3+
4+
This patch version reverts the earlier fixes from Synapse 1.55.1, which could cause problems in certain deployments, and instead adds a cap to the version of Jinja to be installed. Again, this is to fix an incompatibility with version 3.1.0 of the [Jinja](https://pypi.org/project/Jinja2/) library, and again, deployments of Synapse using the `matrixdotorg/synapse` Docker image or Debian packages from packages.matrix.org are not affected.
5+
6+
Internal Changes
7+
----------------
8+
9+
- Pin Jinja to <3.1.0, as Synapse fails to start with Jinja 3.1.0. ([\#12297](https://github.com/matrix-org/synapse/issues/12297))
10+
- Revert changes from 1.55.1 as they caused problems with older versions of Jinja ([\#12296](https://github.com/matrix-org/synapse/issues/12296))
11+
12+
113
Synapse 1.55.1 (2022-03-24)
214
===========================
315

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
matrix-synapse-py3 (1.55.2) stable; urgency=medium
2+
3+
* New synapse release 1.55.2.
4+
5+
-- Synapse Packaging team <[email protected]> Thu, 24 Mar 2022 19:07:11 +0000
6+
17
matrix-synapse-py3 (1.55.1) stable; urgency=medium
28

39
* New synapse release 1.55.1.

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
except ImportError:
6969
pass
7070

71-
__version__ = "1.55.1"
71+
__version__ = "1.55.2"
7272

7373
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
7474
# We import here so that we don't have to install a bunch of deps when

synapse/push/mailer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import bleach
2020
import jinja2
21-
from markupsafe import Markup
2221

2322
from synapse.api.constants import EventTypes, Membership, RoomTypes
2423
from synapse.api.errors import StoreError
@@ -868,7 +867,7 @@ def _make_unsubscribe_link(
868867
)
869868

870869

871-
def safe_markup(raw_html: str) -> Markup:
870+
def safe_markup(raw_html: str) -> jinja2.Markup:
872871
"""
873872
Sanitise a raw HTML string to a set of allowed tags and attributes, and linkify any bare URLs.
874873
@@ -878,7 +877,7 @@ def safe_markup(raw_html: str) -> Markup:
878877
Returns:
879878
A Markup object ready to safely use in a Jinja template.
880879
"""
881-
return Markup(
880+
return jinja2.Markup(
882881
bleach.linkify(
883882
bleach.clean(
884883
raw_html,
@@ -892,7 +891,7 @@ def safe_markup(raw_html: str) -> Markup:
892891
)
893892

894893

895-
def safe_text(raw_text: str) -> Markup:
894+
def safe_text(raw_text: str) -> jinja2.Markup:
896895
"""
897896
Sanitise text (escape any HTML tags), and then linkify any bare URLs.
898897
@@ -902,7 +901,7 @@ def safe_text(raw_text: str) -> Markup:
902901
Returns:
903902
A Markup object ready to safely use in a Jinja template.
904903
"""
905-
return Markup(
904+
return jinja2.Markup(
906905
bleach.linkify(bleach.clean(raw_text, tags=[], attributes=[], strip=False))
907906
)
908907

synapse/python_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
# Note: 21.1.0 broke `/sync`, see #9936
7575
"attrs>=19.2.0,!=21.1.0",
7676
"netaddr>=0.7.18",
77-
"Jinja2>=2.9",
78-
"MarkupSafe>=2.0",
77+
# Jinja2 3.1.0 removes the deprecated jinja2.Markup class, which we rely on.
78+
"Jinja2<3.1.0",
7979
"bleach>=1.4.3",
8080
# We use `ParamSpec`, which was added in `typing-extensions` 3.10.0.0.
8181
"typing-extensions>=3.10.0",

0 commit comments

Comments
 (0)