Ruby Issue Tracking System: Issues
https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2011-02-09T22:55:19Z
Ruby Issue Tracking System
Redmine
Backport187 - Backport #4385 (Closed): YAML encoding error
https://bugs.ruby-lang.org/issues/4385
2011-02-09T22:55:19Z
sand (Andrey Stikheev)
andrey.stikheev@gmail.com
<p>=begin<br>
I'm found a strange behavior of YAML in ruby 1.8.7 on simple string:</p>
<p>ruby-1.8.7-p330 :002 > require 'yaml'<br>
=> true<br>
ruby-1.8.7-p330 :003 > YAML::load("\n {\n}".to_yaml)<br>
ArgumentError: syntax error on line 3, col 0: <code>}' from /Users/sand/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/yaml.rb:133:in </code>load'<br>
from /Users/sand/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/yaml.rb:133:in `load'<br>
from (irb):3</p>
<p>In ruby 1.9.2 seems to be all fine:</p>
<p>ruby-1.9.2-head :011 > require 'yaml'<br>
=> true<br>
ruby-1.9.2-head :012 > YAML::load("\n {\n}".to_yaml)<br>
=> "\n {\n}"</p>
<p>Encoding results:</p>
<p>ruby-1.9.2-head :002 > "\n {\n}".to_yaml<br>
=> "--- "\n {\n\\n}"\n"</p>
<p>ruby-1.8.7-p330 :002 > "\n {\n}".to_yaml<br>
=> "--- |-\n\n {\n}\n"</p>
<p>I'm check this on Mac OS and FreeBSD:</p>
<p>Darwin 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386<br>
FreeBSD 8.0-STABLE FreeBSD 8.0-STABLE<br>
=end</p>
Backport187 - Backport #4329 (Closed): YAML escaping/parsing error
https://bugs.ruby-lang.org/issues/4329
2011-01-27T20:13:18Z
sand (Andrey Stikheev)
andrey.stikheev@gmail.com
<p>=begin<br>
Some strange behavior of YAML in ruby 1.8.7 on simple string:</p>
<p>ruby-1.8.7-p330 :002 > require 'yaml'<br>
=> true<br>
ruby-1.8.7-p330 :003 > YAML::load("\n {\n}".to_yaml)<br>
ArgumentError: syntax error on line 3, col 0: <code>}' from /Users/sand/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/yaml.rb:133:in </code>load'<br>
from /Users/sand/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/yaml.rb:133:in `load'<br>
from (irb):3</p>
<p>In ruby 1.9.2 seems to be all fine:</p>
<p>ruby-1.9.2-head :011 > require 'yaml'<br>
=> true<br>
ruby-1.9.2-head :012 > YAML::load("\n {\n}".to_yaml)<br>
=> "\n {\n}"</p>
<p>Check this on Mac OS and FreeBSD:</p>
<p>Darwin 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386<br>
FreeBSD 8.0-STABLE FreeBSD 8.0-STABLE<br>
=end</p>