Bug #719
closedyaml not precise on some strings
Description
=begin
require 'yaml'
data1 = [{"foo"=>"\n", "bar"=>"baz\n \nbaz"}]
data2 = YAML.load data1.to_yaml
p data1, data2
=>
[{"foo"=>"\n", "bar"=>"baz\n \nbaz"}]
[{"foo"=>"", "bar"=>"baz\n\nbaz"}]
I am not sure if yaml is supposed to return exactly the same value. I used the value for a hash, so I realized it is not exactly the same.
I tested it in 1.8.7 - Brian Candler [email protected] from ruby-mailinglist reported it also on 1.8.4 and 1.9.1-preview1.
thanks.
=end
Files
Updated by paddor (Patrik Wenger) over 16 years ago
- File yaml_specs.pdf yaml_specs.pdf added
=begin
I think this is part of the YAML specification. It allows you to use blank lines to separate data structures.
AFAIK, even the missing space isn't a bug, because YAML values start with the first non-whitespace on a line.
=end
Updated by naruse (Yui NARUSE) over 16 years ago
=begin
YAML can express this object as following,¶
- foo: "\n"
bar: "baz\n \nbaz"
this is syck's bug.
=end
Updated by shyouhei (Shyouhei Urabe) over 16 years ago
- Assignee set to shyouhei (Shyouhei Urabe)
=begin
=end
Updated by mame (Yusuke Endoh) about 15 years ago
- Assignee changed from shyouhei (Shyouhei Urabe) to tenderlovemaking (Aaron Patterson)
- ruby -v set to ruby 1.9.2dev (2010-03-24 trunk 27033) [i686-linux]
=begin
Hi Aaron,
What do you think about this ticket?
require 'yaml'
data1 = [{"foo"=>"\n", "bar"=>"baz\n \nbaz"}]
data2 = YAML.load data1.to_yaml
p data1, data2=>
[{"foo"=>"\n", "bar"=>"baz\n \nbaz"}]
[{"foo"=>"", "bar"=>"baz\n\nbaz"}]
This seems to be still reproduced.
--
Yusuke Endoh [email protected]
=end
Updated by mame (Yusuke Endoh) about 15 years ago
- Status changed from Open to Closed
=begin
Hi,
Syck is deprecated, in effect. This issue won't be fixed.
Instead, try Psych. [ruby-core:29337]
--
Yusuke Endoh [email protected]
=end