[elbe-devel] [PATCH 3/6] elbepack: soap: avoid warnings about old copy of six in spyne
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Tue Jul 2 09:53:33 CEST 2024
Spyne contains a vendored copy of six.
On newer version of Python that generates warnings.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/daemons/soap/__init__.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/elbepack/daemons/soap/__init__.py b/elbepack/daemons/soap/__init__.py
index 055f5df59211..2a371394b856 100644
--- a/elbepack/daemons/soap/__init__.py
+++ b/elbepack/daemons/soap/__init__.py
@@ -7,6 +7,11 @@ import warnings
from beaker.middleware import SessionMiddleware
+# spyne uses a bundled version of six, which triggers warnings in spyne version 2.14.0.
+# As the warnings can happen during any import, a scoped .catch_warnings() is not enough.
+if True: # avoid flake8 errors for the following imports
+ warnings.filterwarnings('ignore', '_SixMetaPathImporter', ImportWarning)
+
from spyne import Application
with warnings.catch_warnings():
warnings.filterwarnings('ignore', "'cgi' is deprecated", DeprecationWarning)
--
2.45.2
More information about the elbe-devel
mailing list