[elbe-devel] [PATCH 2/5] elbepack: don't modify global warning behaviour

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Mar 5 16:11:56 CET 2024


The calls to warnings.simplefilter() modify the global warning
configuration. Doing it at import-time and without
warnings.catch_warnings() means that this configuration is changed in
essentially unpredictable ways.

Instead the warnings should only be configured at the entrypoints or in
a limited scope with `warnings.catch_warnings()`.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/daemons/soap/__init__.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/elbepack/daemons/soap/__init__.py b/elbepack/daemons/soap/__init__.py
index 43f5b129581e..2ce2bee85efa 100644
--- a/elbepack/daemons/soap/__init__.py
+++ b/elbepack/daemons/soap/__init__.py
@@ -3,7 +3,6 @@
 # SPDX-FileCopyrightText: 2014-2017 Linutronix GmbH
 
 import logging
-import warnings
 
 from beaker.middleware import SessionMiddleware
 
@@ -19,9 +18,6 @@ from .esoap import ESoap
 
 logging.getLogger('spyne').setLevel(logging.INFO)
 
-warnings.simplefilter('ignore', category=PendingDeprecationWarning)
-warnings.simplefilter('ignore', category=ResourceWarning)
-
 
 class EsoapApp(Application):
     def __init__(self, *args, **kargs):
-- 
2.44.0



More information about the elbe-devel mailing list