Issue #7232 has been reported by brixen (Brian Ford).

----------------------------------------
Bug #7232: StringIO#gets(nil, nil) raises TypeError, IO/File#gets do not
https://bugs.ruby-lang.org/issues/7232

Author: brixen (Brian Ford)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin10.8.0]


Is this a bug?

sasha:rubinius brian$ irb
1.9.3p286 :001 > require 'stringio'
 => true 
1.9.3p286 :002 > s = StringIO.new "abc"
 => #<StringIO:0x000001008b3d90> 
1.9.3p286 :003 > s.gets nil, nil
TypeError: no implicit conversion from nil to integer
	from (irb):3:in `gets'
	from (irb):3
	from /Users/brian/.rvm/rubies/ruby-1.9.3-p286/bin/irb:16:in `<main>'

sasha:rubinius brian$ irb
1.9.3p286 :001 > f = File.open "foobar.txt"
 => #<File:foobar.txt> 
1.9.3p286 :002 > io = IO.new f.fileno
 => #<IO:fd 5> 
1.9.3p286 :003 > io.gets nil, nil
 => "???????????ес??\n" 
1.9.3p286 :004 > f.rewind
 => 0 
1.9.3p286 :005 > f.gets nil, nil
 => "???????????ес??\n" 

Thanks,
Brian


-- 
http://bugs.ruby-lang.org/