Skip to content

Commit

Permalink
remove deprecated parameter for YAML loader & dumper
Browse files Browse the repository at this point in the history
typ='unsafe' is deprecated

fixes certtools#2489
  • Loading branch information
sebix committed Aug 13, 2024
1 parent c16a8d2 commit d567127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions intelmq/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d567127

Please sign in to comment.