File fix-yaml-loader.patch of Package intelmq

From d56712720268751b6ae257c8f0113db0c3d3fdba Mon Sep 17 00:00:00 2001
From: Sebastian Wagner <sebix@sebix.at>
Date: Tue, 13 Aug 2024 21:32:46 +0200
Subject: [PATCH] remove deprecated parameter for YAML loader & dumper

typ='unsafe' is deprecated

fixes https://github.com/certtools/intelmq/issues/2489
---
 intelmq/lib/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/intelmq/lib/utils.py b/intelmq/lib/utils.py
index 42d551ad9..d8a4e8d13 100644
--- a/intelmq/lib/utils.py
+++ b/intelmq/lib/utils.py
@@ -219,7 +219,7 @@ def load_configuration(configuration_filepath: str) -> dict:
     if os.path.exists(configuration_filepath):
         with open(configuration_filepath) as fpconfig:
             try:
-                config = YAML(typ="unsafe", pure=True).load(fpconfig)
+                config = YAML(pure=True).load(fpconfig)
             except ScannerError as exc:
                 if "found character '\\t' that cannot start any token" in exc.problem:
                     fpconfig.seek(0)
@@ -260,7 +260,7 @@ def write_configuration(configuration_filepath: str,
         pathlib.Path(configuration_filepath + '.bak').write_text(config.read_text())
     with open(configuration_filepath, 'w') as handle:
         if useyaml:
-            YAML(typ="unsafe", pure=True).dump(content, handle)
+            YAML(pure=True).dump(content, handle)
         else:
             json.dump(content, fp=handle, indent=4,
                       sort_keys=True,
openSUSE Build Service is sponsored by