From: "enebo (Thomas Enebo)" Date: 2013-02-13T03:44:29+09:00 Subject: [ruby-core:52162] [ruby-trunk - Bug #7837][Open] IO.open with three arguments where third argument is bogus reports an arity problem instead of type problem Issue #7837 has been reported by enebo (Thomas Enebo). ---------------------------------------- Bug #7837: IO.open with three arguments where third argument is bogus reports an arity problem instead of type problem https://bugs.ruby-lang.org/issues/7837 Author: enebo (Thomas Enebo) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2] I am reporting this against 2.0.rc2 but it also applies to mri 1.9.3. If I run the following one-liner: mri20 -e 'f = File.open("tmp"); IO.open(f.fileno, "r", :heh)' I get the error: -e:1:in `initialize': wrong number of arguments (3 for 1..2) (ArgumentError) This seems wrong because if I change the third argument to an options hash it works fine. So having an arity of 3 is not a problem for open. It is that :heh is not a hash. I think this should generate a TypeError. -- http://bugs.ruby-lang.org/