]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Silence PyYAML warning
authorMichał Kępień <michal@isc.org>
Thu, 23 Apr 2020 06:07:07 +0000 (08:07 +0200)
committerMark Andrews <marka@isc.org>
Tue, 30 Jun 2020 01:43:35 +0000 (11:43 +1000)
Make yaml.load_all() use yaml.SafeLoader to address a warning currently
emitted when bin/tests/system/dnstap/ydump.py is run:

    ydump.py:28: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      for l in yaml.load_all(f.stdout):

(cherry picked from commit 62f631f798ef6d0c3bf52789689ae950c3671115)

bin/tests/system/dnstap/ydump.py

index 2250febe3d31d3c3646d5e7be0b6b7ea5b5c252c..c1c260245928268c2dbf2b6758629daa4eda42f7 100644 (file)
@@ -25,5 +25,5 @@ DATAFILE = sys.argv[2]
 ARGS = [DNSTAP_READ, '-y', DATAFILE]
 
 with subprocess.Popen(ARGS, stdout=subprocess.PIPE) as f:
-    for y in yaml.load_all(f.stdout):
+    for y in yaml.load_all(f.stdout, Loader=yaml.SafeLoader):
         pprint.pprint(y)