Closed GoogleCodeExporter closed 9 years ago
Attaching example YAML file
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 9:04
Attachments:
Well, the YAML is invalid. PyYAML gives the same result:
The document is not valid YAML:
could not determine a constructor for the tag 'tag:yaml.org,2002:value'
in "", line 2, column 8:
part1: =
^
---
part1: =
It will take time to find the exact reason in the specification:
http://yaml.org/spec/1.1/
You can solve it by using quotes:
---
part1: '='
Original comment by py4fun@gmail.com
on 22 May 2014 at 1:05
I see the same bug was logged against PyYAML though:
http://pyyaml.org/ticket/140
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 1:13
I can't put quotes around the = sign, since the document that I have is being
generated in a Ruby app :(
I put my document through yamllint.com and it reformatted the document to this:
---
part1: !ruby/object:YAML::Syck::DefaultKey {}
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 1:16
I don't see any special mention of '=' in that spec. There is a mention here:
http://www.yaml.org/refcard.html of it being a special default mapping, but I
don't see that in the 1.1 spec. Can you point me in the right direction please?
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 1:31
I see no mention of = in the special characters section:
http://yaml.org/spec/1.1/#id868988
I'm confused. I think this _is_ a valid document, and that snakeyaml should
parse it.
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 1:43
Indeed, the issue for PyYAML stays open for 5 years.
I will have a look.
Original comment by py4fun@gmail.com
on 22 May 2014 at 2:55
I had a look into this today, may attached diff adds a test, and an attempt at
a fix.
Original comment by Marc.OMo...@swrve.com
on 22 May 2014 at 3:01
Attachments:
Thank you for the quick patch. The problem is clear now.
SnakeYAML tries to implement "Value Key Language-Independent Type"
(http://yaml.org/type/value.html)
Since:
1) it is not done properly (no tests provided)
2) in the YAML 1.2 it is dropped
we can remove this feature to make '=' work as a standard character.
Feel free to test the source or the latest SNAPSHOT.
If other developers do not object this fix will be released in August 2014
Original comment by py4fun@gmail.com
on 22 May 2014 at 3:39
Fixed.
https://code.google.com/p/snakeyaml/wiki/changes
Original comment by py4fun@gmail.com
on 29 May 2014 at 6:55
Original issue reported on code.google.com by
Marc.OMo...@swrve.com
on 22 May 2014 at 9:03Attachments: