Replace unsafe yaml.load with yaml.safe_load.

This commit is contained in:
Fabio Caccamo 2019-11-18 11:16:53 +01:00
parent cd7c73022b
commit 55737f797a
1 changed files with 2 additions and 3 deletions

View File

@ -109,8 +109,7 @@ def decode_toml(s, **kwargs):
def decode_yaml(s, **kwargs):
kwargs.setdefault('Loader', yaml.Loader)
data = yaml.load(s, **kwargs)
data = yaml.safe_load(s, **kwargs)
return data
@ -186,7 +185,7 @@ def encode_xml(d, **kwargs):
def encode_yaml(d, **kwargs):
data = yaml.dump(d, **kwargs)
data = yaml.dump(dict(d), **kwargs)
return data