Skip to content

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

Closed
cdent wants to merge 3 commits intomasterfrom
cd/yaml4
Closed

Fix object handling in yaml for PyYAML 4.x#252
cdent wants to merge 3 commits intomasterfrom
cd/yaml4

Conversation

@cdent
Copy link
Copy Markdown
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
Copy Markdown
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.

cdent added 2 commits June 28, 2018 14:32
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
Copy Markdown
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