https://redmine.ruby-lang.org/
https://redmine.ruby-lang.org/favicon.ico?1711330511
2010-11-04T02:10:20Z
Ruby Issue Tracking System
Backport187 - Backport #4021: YAML::dump_stream with colons and carriage return (\r)
https://redmine.ruby-lang.org/issues/4021?journal_id=14033
2010-11-04T02:10:20Z
tenderlovemaking (Aaron Patterson)
tenderlove@ruby-lang.org
<ul></ul><p>=begin<br>
On Thu, Nov 04, 2010 at 01:28:02AM +0900, Alejandro Riera wrote:</p>
<blockquote>
<p>Bug <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: YAML::dump_stream with colons and carriage return (\r) (Closed)" href="https://redmine.ruby-lang.org/issues/4021">#4021</a>: YAML::dump_stream with colons and carriage return (\r)<br>
<a href="http://redmine.ruby-lang.org/issues/show/4021" class="external">http://redmine.ruby-lang.org/issues/show/4021</a></p>
<p>Author: Alejandro Riera<br>
Status: Open, Priority: Normal<br>
ruby -v: ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2009.10</p>
<p>I have the following problem:</p>
<p>YAML::dump_stream("foo:\r") #=> "--- foo:\r\n"<br>
if you load it:<br>
YAML::load YAML::dump_stream("foo:\r") #=> {"foo"=>nil}<br>
but it should return "foo:\r"</p>
</blockquote>
<p>This works in 1.9.2 or 1.9.3 if you use Psych as your YAML engine:</p>
<pre><code> [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>
</code></pre>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p>
<p>Attachment: (unnamed)<br>
=end</p>
Backport187 - Backport #4021: YAML::dump_stream with colons and carriage return (\r)
https://redmine.ruby-lang.org/issues/4021?journal_id=79526
2019-07-15T16:08:50Z
jeremyevans0 (Jeremy Evans)
merch-redmine@jeremyevans.net
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby 1.8</i> to <i>Backport187</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/79526/diff?detail_id=53074">diff</a>)</li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>ruby -v</strong> deleted (<del><i>ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2009.10 </i></del>)</li></ul>