From b5c28789c7480a9b84a4b534cc2f060e4a82968a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Michonneau?= Date: Wed, 18 Dec 2019 14:25:25 -0500 Subject: [PATCH] specify YAML loader Co-authored-by: Daniel McCloy c --- bin/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/util.py b/bin/util.py index 5a46cec..f1499ff 100644 --- a/bin/util.py +++ b/bin/util.py @@ -144,7 +144,7 @@ def split_metadata(path, text): metadata_raw = pieces[1] text = pieces[2] try: - metadata_yaml = yaml.load(metadata_raw, Loader=yaml.FullLoader) + metadata_yaml = yaml.load(metadata_raw, Loader=yaml.SafeLoader) except yaml.YAMLError as e: print('Unable to parse YAML header in {0}:\n{1}'.format( path, e), file=sys.stderr) @@ -161,7 +161,7 @@ def load_yaml(filename): try: with open(filename, 'r') as reader: - return yaml.load(reader, Loader=yaml.FullLoader) + return yaml.load(reader, Loader=yaml.SafeLoader) except (yaml.YAMLError, IOError) as e: print('Unable to load YAML file {0}:\n{1}'.format( filename, e), file=sys.stderr) -- 2.30.2