Issue #1869 has been updated by caleb clausen.


I believe that this is not a bug. I'm far from an expert on yaml, but it appears to me that the yaml you posted contains a string ("sklepy") within which you are attempting to store 2 key-value pairs (new: "nowy" & edit: "edytuj"). That's probably not allowed, since strings aren't supposed to have attributes in them. ruby rightly complains about a syntax error in the yaml, tho the first erroneous line is actually the new: "nowy" line, not the edit: "edytuj" line. (And in fact on all ruby versions I can test, it does complain about the new: "nowy" line instead.)

Please note that your second example is not equivalent to the first. The second example succeeds, as it should, because you are first yaml-encoding a string (which happens to be yaml-encoded already, but that's pretty much irrelevant) and then unencoding that (now doubly) encoded string and getting back the original string. If you want to test decoding your example from a string literal instead of a file, you need to eliminate the second level of encoding. For instance:
  YAML::load(("pl:\n  stores: sklepy\n    new: \"nowy\"\n    edit: \"edytuj\"")) #note, no dump
which gives me the same error as loading from a file.

This is not to say that you aren't suffering from a genuine bug of some sort, but it's not characterized properly here. How was your failing example generated? Did you write it by hand or was there a program which created it? If it was created by a program, that program likely contains a bug in its yaml generation logic.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1869

----------------------------------------
http://redmine.ruby-lang.org