diff options
author | Ross Burton <ross@burtonini.com> | 2020-12-10 13:13:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-10 13:39:15 +0000 |
commit | 796be0593a607938aef3941372a9238b7e895446 (patch) | |
tree | 1ba1da807b8827755ca18cdd959ee013cf06e6da /bitbake/lib | |
parent | fe205758a06a7e1cfcca504647da7a82770aeea4 (diff) | |
download | poky-796be0593a607938aef3941372a9238b7e895446.tar.gz |
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/msg.py | 2 |
1 files changed, 1 insertions, 1 deletions
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): | |||
278 | with open(os.path.normpath(userconfigfile), 'r') as f: | 278 | with open(os.path.normpath(userconfigfile), 'r') as f: |
279 | if userconfigfile.endswith('.yml') or userconfigfile.endswith('.yaml'): | 279 | if userconfigfile.endswith('.yml') or userconfigfile.endswith('.yaml'): |
280 | import yaml | 280 | import yaml |
281 | userconfig = yaml.load(f) | 281 | userconfig = yaml.safe_load(f) |
282 | elif userconfigfile.endswith('.json') or userconfigfile.endswith('.cfg'): | 282 | elif userconfigfile.endswith('.json') or userconfigfile.endswith('.cfg'): |
283 | import json | 283 | import json |
284 | userconfig = json.load(f) | 284 | userconfig = json.load(f) |