Project

General

Profile

Actions

Backport #4021

closed

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

Added by ariera (Alejandro Riera) over 13 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
[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

Actions #1

Updated by tenderlovemaking (Aaron Patterson) over 13 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

Actions #2

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby 1.8 to Backport187
  • Description updated (diff)
  • Status changed from Open to Closed
  • ruby -v deleted (ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2009.10 )
Actions

Also available in: Atom PDF

Like0
Like0Like0