msg: use safe YAML loader
PATCH 1/1 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 <[email protected]>
--- bitbake/lib/bb/msg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/msg.py +1 -1
@@ -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)
Signature · 1 line
2.25.1