Project

General

Profile

Bug #4021

YAML::dump_stream with colons and carriage return (\r)

Added by ariera (Alejandro Riera) over 8 years ago. Updated about 8 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2009.10
[ruby-core:33038]

Description

=begin
I have the following problem:

YAML::dump_stream("foo:\r") #=> "--- foo:\r\n"
if you load it:
YAML::load YAML::dump_stream("foo:\r") #=> {"foo"=>nil}
but it should return "foo:\r"
=end

History

#1

Updated by tenderlovemaking (Aaron Patterson) over 8 years ago

=begin
On Thu, Nov 04, 2010 at 01:28:02AM +0900, Alejandro Riera wrote:

Bug #4021: YAML::dump_stream with colons and carriage return (\r)
http://redmine.ruby-lang.org/issues/show/4021

Author: Alejandro Riera
Status: Open, Priority: Normal
ruby -v: ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2009.10

I have the following problem:

YAML::dump_stream("foo:\r") #=> "--- foo:\r\n"
if you load it:
YAML::load YAML::dump_stream("foo:\r") #=> {"foo"=>nil}
but it should return "foo:\r"

This works in 1.9.2 or 1.9.3 if you use Psych as your YAML engine:

 [apatterson@ypcmc08885 ~]$ irb
 irb(main):001:0> RUBY_VERSION
 => "1.9.3"
 irb(main):002:0> require 'yaml'
 => true
 irb(main):003:0> YAML::load YAML::dump_stream("foo:\r")
 => {"foo"=>nil}
 irb(main):004:0> YAML::ENGINE.yamler = 'psych'
 => "psych"
 irb(main):005:0> YAML::load YAML::dump_stream("foo:\r")
 => "foo:\r"
 irb(main):006:0>

--
Aaron Patterson
http://tenderlovemaking.com/

Attachment: (unnamed)
=end

Also available in: Atom PDF