Skip to content

Use yaml.safe_load() instead of load() #921

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

Merged
merged 1 commit into from
Apr 16, 2019

Conversation

nsoranzo
Copy link
Member

Fix warnings like:

planemo/shed/__init__.py:436: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(f)

Fix warnings like:

```
planemo/shed/__init__.py:436: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(f)
```
@martenson
Copy link
Member

This is pure refactoring, right? afair safe() is just a wrapper around safe_load() now.

@nsoranzo
Copy link
Member Author

You mean load() is just a wrapper?

And no, if you read at link in the message above it clearly states:

Since load cannot break backward compatibility to call safe_load, the maintainers of PyYAML decided to simply deprecate the plain usage of load, and require that the user intentionally declare the Loader they desired.

and

FullLoader: Loads the full YAML language. Avoids arbitrary code execution. This is currently (PyYAML 5.1) the default loader called by yaml.load(input) (after issuing the warning).

while safe_load() use the SafeLoader.

@martenson
Copy link
Member

My memory failed me then. 👀

@nsoranzo nsoranzo merged commit d20a1e4 into galaxyproject:master Apr 16, 2019
@nsoranzo nsoranzo deleted the safe_load branch April 16, 2019 23:07
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