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

YAMLLoadWarning: calling yaml.load() #1450

Closed
vincesesto opened this issue Aug 12, 2019 · 1 comment
Closed

YAMLLoadWarning: calling yaml.load() #1450

vincesesto opened this issue Aug 12, 2019 · 1 comment

Comments

@vincesesto
Copy link

Expected Behavior

Script should not warn about loading YAML file

Actual Behavior

We are getting the following error when running:

/usr/local/lib/python3.7/site-packages/curator/utils.py:53: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details

The problem is this line:

try:
return yaml.load(read_file(path))
except yaml.scanner.ScannerError as err: except yaml.scanner.ScannerError as err:

As discussed on the page linked in the error this problem needs to be changed to something like:

return yaml.load(read_file(path), Loader=yaml.FullLoader)

or:

return yaml.load(read_file(path), Loader=yaml.SafeLoader)

Steps to Reproduce the Problem

Run the script

Specifications

  • Version: Latest
  • Platform: Linux
  • Subsystem: Python

Context (Environment)

This is effecting us cause we are seeing:
The problem is this line:

try:
return yaml.load(read_file(path))
except yaml.scanner.ScannerError as err: except yaml.scanner.ScannerError as err:

As discussed on the page linked in the error this problem needs to be changed to something like:

return yaml.load(read_file(path), Loader=yaml.FullLoader)

or:

return yaml.load(read_file(path), Loader=yaml.SafeLoader)

@untergeek
Copy link
Member

This is a known issue, and is reported in #1415, and is tied to #1368. I can't address #1415 until I can safely address #1368. To address #1368 requires breaking changes to the API.

This will be addressed in the next major version of Curator, and unfortunately, not before.

Closing as duplicate.

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

2 participants