aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/msg.py
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2020-12-10 13:13:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-10 13:38:11 +0000
commit71aaac9efa69abbf6c27d174e0862644cbf674ef (patch)
tree883d189b01f9ac2b2b9f4efd2f2d8582b64d4478 /lib/bb/msg.py
parent77790e3656048eff5cb1a086c727d86d32773b68 (diff)
downloadbitbake-71aaac9efa69abbf6c27d174e0862644cbf674ef.tar.gz
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(). Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r--lib/bb/msg.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index 6f17b6acc..291b38ff7 100644
--- a/lib/bb/msg.py
+++ b/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)