Skip to content

[RST-6280] Support for YAML 6.0+#2

Merged
ShivamThukral merged 2 commits into
masterfrom
RST-6280-yaml-loader
Nov 8, 2022
Merged

[RST-6280] Support for YAML 6.0+#2
ShivamThukral merged 2 commits into
masterfrom
RST-6280-yaml-loader

Conversation

@ShivamThukral
Copy link
Copy Markdown
Contributor

@ShivamThukral ShivamThukral commented Nov 4, 2022

Added a line which will remove the error Error: load() missing 1 required positional argument: 'Loader'.
Related PR: yaml/pyyaml#561
The branch protection rules were not set for the master. I have added them as well. Please have a look at them too.
Tested versions:

  • python: 3.8
  • yaml: 6.0

Comment thread copyrightify/copyrightify.py Outdated
def main():
try:
config = yaml.load(resource_string(__name__, 'config.yaml'))
config = yaml.load(resource_string(__name__, 'config.yaml'), Loader=yaml.FullLoader)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is generally recommended to use the safe_load command instead of the load command.
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html
Which I think is basically the equivalent of Loader=yaml.SafeLoader.

Copy link
Copy Markdown
Member

@paulbovbel paulbovbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@ShivamThukral ShivamThukral merged commit 96c58e6 into master Nov 8, 2022
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.

3 participants