Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Use PyYAML >= 5.1 #40

Merged
merged 3 commits into from
Oct 1, 2019
Merged

Use PyYAML >= 5.1 #40

merged 3 commits into from
Oct 1, 2019

Conversation

mzagozen
Copy link
Contributor

@mzagozen mzagozen commented Oct 1, 2019

People are getting CVE hits on using an old PyYAML version. While it is possible to change usage of pyyaml to use yaml.safe_load even with the old version, that won't make the warning go away. It's best to just upgrade to latest. I had this branch with PyYAML 5.x compatibility fixes ready to go, but was waiting on PyYAML 5.2 to be released. It has been 6 months now. I don't think it's happening any time soon.

Anyway, the current 5.1 version has a bug where you must explicitly register the loader for every custom directive parsing class. This was supposed to be a global setting - like you specifiy you only want to use SafeLoader, but it doesn't work. Even with the explicit workaround, IMHO this is an improvement on the old version as it includes more documentation :)

@an2deg I set your rel-0.1.8 branch as the base here, as that is the current public release.

Closes #39

mzagozen added 3 commits May 6, 2019 14:26
Creating a "magic" tag class for PyYAML by extending yaml.YAMLObject
is equivalent to registering the methods manually with
yaml.add_representer and yaml.add_constructor - only one approach is
needed.
With PyYAML 5.1, `yaml.load` was deprecated, see https://msg.pyyaml.org/load
To guard against potential future vulnerabilities, use SafeLoader in
this package.
The code was changed to be compatible with the new version.
@an2deg
Copy link
Owner

an2deg commented Oct 1, 2019

Thank you @mzagozen

@an2deg an2deg merged commit fb1b1be into an2deg:rel-0.1.8 Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants