Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yaml.safe_load instead of yaml.load in check-event-schema-examples.py #3716

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Feb 8, 2022

PyYAML 6.0 requires a Loader argument to be passed to yaml.load. We could pass yaml.SafeLoader, or simply use the yaml.safe_load method instead. This PR opts to do the latter for simplicity.

The previous default loader was yaml.FullLoader, and as such this PR changes the behaviour to yaml.SafeLoader. I don't think this has any actual repercussions on the data that we're loading in however. https://msg.pyyaml.org/load has more details, and even recommends that FullLoader no longer be used.

This PR is required for this script to work with PyYAML 6.0.

Preview: https://pr3716--matrix-org-previews.netlify.app

PyYAML 6.0 [requires](yaml/pyyaml#561) a Loader
argument to be passed to yaml.load. We could pass yaml.SafeLoader, or simply
use the yaml.safe_load method instead. This PR opts to do the latter for simplicity.

The previous default loader was yaml.Loader, and as such this PR changes the
behaviour to yaml.SafeLoader. I don't think this has any actual repurcussions
on the data that we're loading in however. https://msg.pyyaml.org/load has more
details, and even recommends that FullLoader no longer be used.
@anoadragon453 anoadragon453 requested a review from a team February 8, 2022 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants