Bug #1869: YAML parser problem
http://redmine.ruby-lang.org/issues/show/1869

Author: Pawel Barcik
Status: Open, Priority: High
ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

When I try to load a file with a content like this:
pl:
  stores: sklepy
    new: "nowy"
    edit: "edytuj"

with command like this

YAML::load("/file/path"))

I am getting this:

irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> YAML.load_file('/ruby_apps/ndc/config/locales/i18n-routes.yml')
ArgumentError: syntax error on line 2, col 9: `    edit: "edytuj"'
	from /usr/local/lib/ruby1.9/1.9.1/yaml.rb:133:in `load'
	from /usr/local/lib/ruby1.9/1.9.1/yaml.rb:133:in `load'
	from /usr/local/lib/ruby1.9/1.9.1/yaml.rb:144:in `block in load_file'
	from /usr/local/lib/ruby1.9/1.9.1/yaml.rb:143:in `open'
	from /usr/local/lib/ruby1.9/1.9.1/yaml.rb:143:in `load_file'
	from (irb):2
	from /usr/local/bin/irb1.9:12:in `<main>'

but when I do something like this:

irb(main):035:0> YAML::load(YAML::dump("pl:\n  stores: sklepy\n    new: \"nowy\"\n    edit: \"edytuj\""))
=> "pl:\n  stores: sklepy\n    new: \"nowy\"\n    edit: \"edytuj\""

there is no error message


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