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

yaml.load(input) deprecated #110

Closed
qlquanle opened this issue Apr 15, 2019 · 5 comments
Closed

yaml.load(input) deprecated #110

qlquanle opened this issue Apr 15, 2019 · 5 comments

Comments

@qlquanle
Copy link
Contributor

Hi all!

yaml/pyyaml deprecated yaml.load() so I'm getting the following warning when I run the template:

../config/configuration.py:42: 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[key] = yaml.load(open(val, 'rU'))

The relevant documentation is here:

https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Please let me know if I can provide any more information!

DavidRitzwoller added a commit that referenced this issue Jan 30, 2020
DavidRitzwoller added a commit that referenced this issue Jan 30, 2020
@DavidRitzwoller
Copy link
Contributor

The problem has been addressed and #113 is open for PR

DavidRitzwoller added a commit that referenced this issue Jan 30, 2020
@zkashner
Copy link
Contributor

On older OS-es (such as my own) I believe that with python2, yaml is a system package and not possible to be upgraded. My installation of yaml does not have FullLoader so I have to revert this change locally. I am not sure what the best workaround is for this--but wanted to flag it.

@DavidRitzwoller
Copy link
Contributor

DavidRitzwoller commented Jul 21, 2020

@zkashner Is it not possible to use a different installation of python, say managed by anaconda?

@zkashner
Copy link
Contributor

@DavidRitzwoller I ended up getting it to work (by replacing Loader=yaml.FullLoader with Loader=yaml.SafeLoader.)
It could be worth replacing FullLoader with SafeLoader as I believe that the functionality that we need from this yaml load should be included in SafeLoader and it will not cause older installs of python problems (and adds to ease of use and adoption to not need to have an anaconda version of python.) What do you think?

@DavidRitzwoller
Copy link
Contributor

Thanks @zkashner. From my understanding of this it seems like SafeLoader is the correct protocol for our context. So definitely agree that this seems smart to implement.

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

No branches or pull requests

3 participants