-
Notifications
You must be signed in to change notification settings - Fork 526
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
Parsing of trailing TAB works differently for Python and C #594
Comments
The short answer to your query is that in this case libyaml is right and pyyaml is wrong. https://play.yaml.io/main/parser?input=ImJhciIJ shows the results of 14 YAML parsers, and PyYAML, Ruamel (fork of PyYAML) and SnakeYAML get this one wrong. The productions involved are:
Which is spaces and tabs. |
In which you show the libyaml test suite not working, I was able to run this:
Hope that helps. Note: I'll still be looking into improving the state of libyaml's testing. |
It is not about right or wrong, it is about that the very same parser either succeeds of fails for the same YAML document. |
Ah but they are not the very same parser. They are the 2 distinctly different parsers that PyYAML contains. A pure Python one and libyaml. Note that libyaml was originally a direct port from PyYAML, written by the same person. There are several known places where PyYAML using pure Python and PyYAML using libyaml differ. These are of course bugs, either in the Python code or libyaml. Note: It was my understanding that you were trying to find out how to interpret the spec, so that you could implement your SnakeYAML Java YAML parser correctly. |
other repos have this bug because of pyyaml: docker/compose#5662 |
@ingydotnet I think this use case is not defined in the test suite |
This works properly (note the trailing TAB):
This fails:
The text was updated successfully, but these errors were encountered: