Project

General

Profile

Actions

Bug #719

closed

yaml not precise on some strings

Added by MrO (a b) over 16 years ago. Updated about 14 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2dev (2010-03-24 trunk 27033) [i686-linux]
Backport:
[ruby-core:19721]

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 from ruby-mailinglist reported it also on 1.8.4 and 1.9.1-preview1.

thanks.
=end


Files

yaml_specs.pdf (1.01 MB) yaml_specs.pdf YAML Specification paddor (Patrik Wenger), 11/12/2008 08:11 AM
Actions #1

Updated by paddor (Patrik Wenger) over 16 years ago

=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

Actions #2

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

Actions #3

Updated by shyouhei (Shyouhei Urabe) over 16 years ago

  • Assignee set to shyouhei (Shyouhei Urabe)

=begin

=end

Actions #4

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
=end

Actions #5

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
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0