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

Update yaml usage to work with pyyaml 5.1+ #70

Closed
djhoese opened this issue Apr 22, 2019 · 0 comments · Fixed by #71
Closed

Update yaml usage to work with pyyaml 5.1+ #70

djhoese opened this issue Apr 22, 2019 · 0 comments · Fixed by #71

Comments

@djhoese
Copy link
Member

djhoese commented Apr 22, 2019

Importing pyspectral's config.py module results in:

/Users/davidh/repos/git/pyspectral/pyspectral/config.py:75: 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 = recursive_dict_update(config, yaml.load(fp_))

This is because of a deprecation in pyyaml 5.1+ (see here).

This should be updated to use:

try:
    from yaml import UnsafeLoader
except ImportError:
    from yaml import Loader as UnsafeLoader

res = yaml.load(file, Loader=UnsafeLoader)
djhoese added a commit to djhoese/pyspectral that referenced this issue Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant