<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/psych/test_stringio.rb, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/psych] Fix dumping `StringIO` (and potentially others) on Ruby &lt;= 2.7</title>
<updated>2025-05-12T16:19:38+00:00</updated>
<author>
<name>Earlopain</name>
<email>14981592+Earlopain@users.noreply.github.com</email>
</author>
<published>2025-05-12T15:51:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0c94ae048a277485aa691820277108c2335ec3d3'/>
<id>0c94ae048a277485aa691820277108c2335ec3d3</id>
<content type='text'>
In Ruby &lt; 3.0, the superclass of StringIO was actually already `Data`,
but it doesn't have the expected shape. So, on these earlier versions it errors:
&gt; NoMethodError: undefined method `members' for #&lt;StringIO:0x00005641dd5f2880&gt;
&gt;    vendor/bundle/ruby/2.6.0/gems/psych-5.2.5/lib/psych/visitors/yaml_tree.rb:170:in `visit_Data'

This test doesn't fail on 2.7, presumably because it can pull in a newer `stringio` version.

https://github.com/ruby/psych/commit/0f40f56268
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Ruby &lt; 3.0, the superclass of StringIO was actually already `Data`,
but it doesn't have the expected shape. So, on these earlier versions it errors:
&gt; NoMethodError: undefined method `members' for #&lt;StringIO:0x00005641dd5f2880&gt;
&gt;    vendor/bundle/ruby/2.6.0/gems/psych-5.2.5/lib/psych/visitors/yaml_tree.rb:170:in `visit_Data'

This test doesn't fail on 2.7, presumably because it can pull in a newer `stringio` version.

https://github.com/ruby/psych/commit/0f40f56268
</pre>
</div>
</content>
</entry>
</feed>
