I've run into some issues where the writer produces files that cannot be parsed again, when string keys are present, which start with special characters. A few examples are:
for char in [
"{", "}", "[", "]", "&", "*", "#", "?", "|", "-", "<", ">",
"=", "!", "%", "@", ":", "`", ",", "'", "\"",
]
d = Dict(char => 0.0)
@test YAML.load(YAML.yaml(d)) == d
end
As an example, YAML.yaml(Dict(">" => 0.0)) produces:
>: 0.0
which does not parse.
By comparison, Python's YAML writer successfully handles these by quoting the key:
I've run into some issues where the writer produces files that cannot be parsed again, when string keys are present, which start with special characters. A few examples are:
As an example,
YAML.yaml(Dict(">" => 0.0))
produces:which does not parse.
By comparison, Python's YAML writer successfully handles these by quoting the key: