Upgrade pyyaml to the latest bugfix release for the next stable version:
5.1.2. This fixes a build failure when Python is 3.9. This requires
migrating to yaml.safe_load to avoid warnings due to the use of unsafe
load() method.
Details
Diff Detail
- Repository
- rLNT LNT
Event Timeline
Hmm the last time I upgraded pyyaml it started complaining about the interface we're using being insecure and a security issue. is that no longer the case?
I remember it required slight tweaking.
I didn't get any warning, except for pip complaining about being run as root but that's a separate issue
Hmm ok, It should be giving this warning https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation when LNT starts up.
But if you don't see it they might have did something to not require it.. so LGTM then.
Running tox with this change results in the warning appearing, for example:
~/git/llvm-lnt/.tox/py3/lib/python3.6/site-packages/lnt/lnttool/admin.py:53: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
I'd recommend switching the couple of yaml.load calls with yaml.safe_load.
Builds and runs without warning for the current alpine base image (based on Python 3.7).
I had only run the tests and launched LNT. I see one of the codepath that uses yaml.load is in lnt admin. I've made an updated patch that update all the calls to load to use safe_load instead and it seems to work.