Always output document end before directive (YAML 1.2 compatibility) #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In YAML 1.1, the document end marker
...
is optional even if the next document starts with a directive:https://github.com/yaml/pyyaml/blob/master/tests/data/spec-07-09.canonical
It is only required if the scalar is "open ended", for example for plain scalars.
My suggestion would be to make the output 1.2 compatible. It will still be 1.1 compatible, so that shouldn't be a problem.
In YAML 1.2 the
...
marker is always required before a directive. So the new output looks like:I believe this will also make it easier to resolve
#123
(no github, this will not fix 123) which was introduced with the last fixes regardingopen_ended
. I think I can make a fix for this soon after this issue is fixed.Fixing #123 without this would be a bit more complicated.
If we do this, we also need to adjust PyYAML to behave the same.
Related issues/commits: