[elbe-devel] [PATCH] elbepack: don't transform all warnings into exceptions

Benedikt Spranger b.spranger at linutronix.de
Fri Feb 23 17:03:37 CET 2024


Am Mon, 12 Feb 2024 14:09:51 +0100
schrieb Thomas Weißschuh <thomas.weissschuh at linutronix.de>:

> 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.
> 
> The call to `warnings.simplefilter('error')` transforms *all*
> warnings for *all* modules into exceptions.
> This breaks the initvm on bookworm as the six library used by the spyne
> library triggers a warning on python3 which then crashes the
> application [0].
> The emitted warning however is completely harmless and even ignored in
> the default configuration.
> 
> Instead change the configuration only in the narrow scope it is
> necessary in.
> 
> [0] https://github.com/arskom/spyne/pull/704
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
Reviewed-by: Benedikt Spranger <b.spranger at linutronix.de>


More information about the elbe-devel mailing list