strictyaml
strictyaml copied to clipboard
Documents with single scalars or only comments do not parse correctly
Unless I am missing something, which is certainly possible, I do not think StrictYAML is correctly parsing documents that consist either of only comments or comments with a single scalar. Example document:
# Some comment.
"A string value."
Using ruamel.yaml:
doc = '# Some comment.\n"A string value."'
from ruamel.yaml import YAML
print(YAML().load(doc))
The output is:
A string value.
With StrictYAML:
import strictyaml
print(strictyaml.load(doc))
The output is:
# Some comment.
"A string value."
It appears that StrictYAML is including the comment in the scalar value.
Thanks for the great work on StrictYAML and for any help with this issue.
Yep, that looks like a bug, thanks for reporting.
I have the same problem with the current version of strictyaml.
Is this supposedly fixed?