package/python-crossbar: use escape from markupsafe
PATCH 1/1 package/python-crossbar: use escape from markupsafe
The last version bump of python-werkzeug v2.1.2 introduced a runtime issue in python-crossbar since escape from werkzeug has been removed since werkzeug 2.1.0 [1].
This has been fixed in python-crossbar v24.4.1 but we do not want to bump this package for the Buildroot release 2022.05. Instead apply the same change as the upstream commit [2] using escape from python-markupsafe package.
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/2520606768
[1] https://github.com/pallets/werkzeug/commit/22d1e9ac13829b83347107a9b4d77072a8e1af6a
[2] https://github.com/crossbario/crossbar/commit/ca8d383f01231e2b3f986e791f215f12f2deee5d
--- ...ice-wap-use-markupsafe-instead-of-we.patch | 40 +++++++++++++++++++ package/python-crossbar/Config.in | 1 + 2 files changed, 41 insertions(+) create mode 100644 package/python-crossbar/0003-crossbar-webservice-wap-use-markupsafe-instead-of-we.patch
package/python-crossbar/0003-crossbar-webservice-wap-use-markupsafe-instead-of-we.patch new file +40 -0
@@ -0,0 +1,40 @@ +From ac5fc826e33492bb0c4283a954389d7fd355fa61 Mon Sep 17 00:00:00 2001 +From: Romain Naour <[email protected]> +Date: Mon, 30 May 2022 19:38:11 +0200 +Subject: [PATCH] crossbar/webservice/wap: use markupsafe instead of werkzeug + +wap.py use escape from werkzeug but it has been removed since +the version 2.1.0 [1]. + +Replace with escape from markupsafe like upstream commit [2] +(wihout other changes). + +[1] https://github.com/pallets/werkzeug/commit/22d1e9ac13829b83347107a9b4d77072a8e1af6a +[2] https://github.com/crossbario/crossbar/commit/ca8d383f01231e2b3f986e791f215f12f2deee5d + +Signed-off-by: Romain Naour <[email protected]> +--- + crossbar/webservice/wap.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/crossbar/webservice/wap.py b/crossbar/webservice/wap.py +index 825558b1..6daa9b21 100644 +--- a/crossbar/webservice/wap.py ++++ b/crossbar/webservice/wap.py +@@ -36,7 +36,12 @@ from collections.abc import Mapping, Sequence + + from werkzeug.routing import Map, Rule + from werkzeug.exceptions import NotFound, MethodNotAllowed +-from werkzeug.utils import escape ++ ++try: ++ # removed in werkzeug 2.1.0 ++ from werkzeug.utils import escape ++except ImportError: ++ from markupsafe import escape + + from jinja2 import Environment, FileSystemLoader + from jinja2.sandbox import SandboxedEnvironment +-- +2.35.3 +
package/python-crossbar/Config.in +1 -0
@@ -15,6 +15,7 @@ config BR2_PACKAGE_PYTHON_CROSSBAR select BR2_PACKAGE_PYTHON_INCREMENTAL select BR2_PACKAGE_PYTHON_JINJA2 select BR2_PACKAGE_PYTHON_LMDB + select BR2_PACKAGE_PYTHON_MARKUPSAFE select BR2_PACKAGE_PYTHON_MISTUNE select BR2_PACKAGE_PYTHON_NETADDR select BR2_PACKAGE_PYTHON_PASSLIB
Signature · 6 lines
2.35.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Yann E. MORIN
AppliedRomain, All,
On 2022-05-30 20:35 +0200, Romain Naour spake thusly:
Quoted 9 lines
The last version bump of python-werkzeug v2.1.2 introduced a runtime issue in python-crossbar since escape from werkzeug has been removed since werkzeug 2.1.0 [1].
This has been fixed in python-crossbar v24.4.1 but we do not want to bump this package for the Buildroot release 2022.05. Instead apply the same change as the upstream commit [2] using escape from python-markupsafe package.
Quoted 8 lines
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/2520606768[1] https://github.com/pallets/werkzeug/commit/22d1e9ac13829b83347107a9b4d77072a8e1af6a
[2] https://github.com/crossbario/crossbar/commit/ca8d383f01231e2b3f986e791f215f12f2deee5dSigned-off-by Romain Naour <[email protected]>Cc James Hilliard <[email protected]>
Applied to master, thanks.
Regards,
Yann E. MORIN.
Quoted 71 lines
--- ...ice-wap-use-markupsafe-instead-of-we.patch | 40 +++++++++++++++++++ package/python-crossbar/Config.in | 1 + 2 files changed, 41 insertions(+) create mode 100644 package/python-crossbar/0003-crossbar-webservice-wap-use-markupsafe-instead-of-we.patchpackage/python-crossbar/0003-crossbar-webservice-wap-use-markupsafe-instead-of-we.patch new file +40
-0@@ -0,0 +1,40 @@ +From ac5fc826e33492bb0c4283a954389d7fd355fa61 Mon Sep 17 00:00:00 2001 +From: Romain Naour <[email protected]> +Date: Mon, 30 May 2022 19:38:11 +0200 +Subject: [PATCH] crossbar/webservice/wap: use markupsafe instead of werkzeug + +wap.py use escape from werkzeug but it has been removed since +the version 2.1.0 [1]. + +Replace with escape from markupsafe like upstream commit [2] +(wihout other changes). + +[1] https://github.com/pallets/werkzeug/commit/22d1e9ac13829b83347107a9b4d77072a8e1af6a +[2] https://github.com/crossbario/crossbar/commit/ca8d383f01231e2b3f986e791f215f12f2deee5d + +Signed-off-by: Romain Naour <[email protected]> +--- + crossbar/webservice/wap.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/crossbar/webservice/wap.py b/crossbar/webservice/wap.py +index 825558b1..6daa9b21 100644 +--- a/crossbar/webservice/wap.py ++++ b/crossbar/webservice/wap.py +@@ -36,7 +36,12 @@ from collections.abc import Mapping, Sequence + + from werkzeug.routing import Map, Rule + from werkzeug.exceptions import NotFound, MethodNotAllowed +-from werkzeug.utils import escape ++ ++try: ++ # removed in werkzeug 2.1.0 ++ from werkzeug.utils import escape ++except ImportError: ++ from markupsafe import escape + + from jinja2 import Environment, FileSystemLoader + from jinja2.sandbox import SandboxedEnvironment +-- +2.35.3 +package/python-crossbar/Config.in +1
-0@@ -15,6 +15,7 @@ config BR2_PACKAGE_PYTHON_CROSSBAR select BR2_PACKAGE_PYTHON_INCREMENTAL select BR2_PACKAGE_PYTHON_JINJA2 select BR2_PACKAGE_PYTHON_LMDB + select BR2_PACKAGE_PYTHON_MARKUPSAFE select BR2_PACKAGE_PYTHON_MISTUNE select BR2_PACKAGE_PYTHON_NETADDR select BR2_PACKAGE_PYTHON_PASSLIBSignature · 6 lines
2.35.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot