Skip to content

Commit aac3f16

Browse files
authored
Always use a Loader in yaml.load (#745)
A recent change within pyyaml 6.0 has enforce use of a Loader argument to yaml.load [1]. To comply, Bandit will use yaml.load with a Loader always. The plugin to check for unsafe loaders of yaml module still applies. [1] yaml/pyyaml#561 Closes #744 Signed-off-by: Eric Brown <[email protected]>
1 parent 44f5c41 commit aac3f16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: tests/unit/formatters/test_yaml.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_report(self, get_issue_list):
7070
self.issue.confidence)
7171

7272
with open(self.tmp_fname) as f:
73-
data = yaml.load(f.read())
73+
data = yaml.load(f.read(), Loader=yaml.SafeLoader)
7474
self.assertIsNotNone(data['generated_at'])
7575
self.assertEqual(self.tmp_fname, data['results'][0]['filename'])
7676
self.assertEqual(self.issue.severity,

0 commit comments

Comments
 (0)