Skip to content

Commit

Permalink
specify YAML loader
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel McCloy <dan.mccloy@gmail.com>c
  • Loading branch information
fmichonneau committed Dec 18, 2019
1 parent a0c0681 commit b5c2878
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit b5c2878

Please sign in to comment.