swap unsafe yaml.load usage for yaml.safe_load (#2324)

Related to #2323

Recommend additionally adding a step in CI
ensuring use of `yaml.load` is prevented from existing in the code base.
This commit is contained in:
Michael H 2018-12-13 12:19:27 -05:00 committed by Kowlin
parent 7546c50226
commit 985e7b3c6d
2 changed files with 2 additions and 2 deletions

View File

@ -504,7 +504,7 @@ class Trivia(commands.Cog):
with path.open(encoding="utf-8") as file:
try:
dict_ = yaml.load(file)
dict_ = yaml.safe_load(file)
except yaml.error.YAMLError as exc:
raise InvalidListError("YAML parsing failed.") from exc
else:

View File

@ -10,7 +10,7 @@ def test_trivia_lists():
for l in list_names:
with l.open() as f:
try:
dict_ = yaml.load(f)
dict_ = yaml.safe_load(f)
except yaml.error.YAMLError as e:
problem_lists.append((l.stem, "YAML error:\n{!s}".format(e)))
else: