You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which makes sense, until one considers that this key (y) is actually a boolean according to the yaml spec, and is parsed as such by other yaml parsers (for example: https://pkg.go.dev/sigs.k8s.io/yaml) which would read this as:
true: 1
I would instead expect this output from yaml.dump:
"y": 1
I realize that default_style='"' is an option for me, however the written result is extremely verbose / different from a standard yaml file, pretty much defeating the purpose of using yaml in the first place.
Goofy yaml decision aside, I'm quite surprised to find a standard python lib deviating from the spec in this way.
The text was updated successfully, but these errors were encountered:
There are many issues related to that, see #486 and especially #247
A PR #555 which supports YAML 1.2 is ready, but the decision was made that this should only be available with a new kind of API #700
Then it would be easy to define a "corrected" YAML 1.1 tagset along with the backwards compatible one.
Thanks! I imagine each instance of this sort of issue is quite specific, so did not find those. Feel free to close as dupe, or leave open if you'd prefer to close it alongside the fix.
When calling
yaml.dump({"y": 1})
I end up with:Which makes sense, until one considers that this key (
y
) is actually a boolean according to the yaml spec, and is parsed as such by other yaml parsers (for example: https://pkg.go.dev/sigs.k8s.io/yaml) which would read this as:I would instead expect this output from yaml.dump:
I realize that
default_style='"'
is an option for me, however the written result is extremely verbose / different from a standard yaml file, pretty much defeating the purpose of using yaml in the first place.Goofy yaml decision aside, I'm quite surprised to find a standard python lib deviating from the spec in this way.
The text was updated successfully, but these errors were encountered: