From 796be0593a607938aef3941372a9238b7e895446 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Thu, 10 Dec 2020 13:13:41 +0000 Subject: bitbake: msg: use safe YAML loader If using a YAML file in BB_LOGCONFIG, the unsafe loader is used and this causes a runtime warning: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. As log configuration YAML is relatively simple we can just use safe_load(). (Bitbake rev: 71aaac9efa69abbf6c27d174e0862644cbf674ef) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- bitbake/lib/bb/msg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py index 6f17b6acc7..291b38ff7f 100644 --- a/bitbake/lib/bb/msg.py +++ b/bitbake/lib/bb/msg.py @@ -278,7 +278,7 @@ def setLoggingConfig(defaultconfig, userconfigfile=None): with open(os.path.normpath(userconfigfile), 'r') as f: if userconfigfile.endswith('.yml') or userconfigfile.endswith('.yaml'): import yaml - userconfig = yaml.load(f) + userconfig = yaml.safe_load(f) elif userconfigfile.endswith('.json') or userconfigfile.endswith('.cfg'): import json userconfig = json.load(f) -- cgit v1.2.3-54-g00ecf