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

Fix object handling in yaml for PyYAML 4.x #252

Closed
wants to merge 3 commits into from
Closed

Fix object handling in yaml for PyYAML 4.x #252

wants to merge 3 commits into from

Conversation

cdent
Copy link
Owner

@cdent cdent commented Jun 28, 2018

PyYAML 4.x is "safe" by default and in that context safe
means that arbitrary python objects are not okay. However,
defined tags which are added by the running process are
safe.

This change updates gabbi so that if unsafe YAML is desired,
the new "danger_load" function is used and expands the
NanChecker related tests to reflect this different
understanding of safe and unsafe. I suspect our tests
were incorrect in the past.

PyYAML 4.x is "safe" by default and in that context safe
means that arbitrary python objects are not okay. However,
defined tags which are added by the running process are
safe.

This change updates gabbi so that if unsafe YAML is desired,
the new "danger_load" function is used and expands the
NanChecker related tests to reflect this different
understanding of safe and unsafe. I suspect our tests
were incorrect in the past.
@cdent
Copy link
Owner Author

cdent commented Jun 28, 2018

Don't intend to merge this yet, still trying to work out if it is right. "Safe" has changed.

This reflects the behavior of "safe" that I've been able to
deduce.
If danger_load doesn't exist then we are in an older version and
we fall back to load (as the unsafe load).

This makes it possible to use this same code to switch back and
forth between PyYAML 3 and 4 and get different results.
@cdent
Copy link
Owner Author

cdent commented Mar 5, 2019

This is covered by #267

@cdent cdent closed this Mar 5, 2019
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.

1 participant