From: nobu.nokada@... Date: 2004-10-29T19:03:11+09:00 Subject: Re: BUG in File Hi, At Fri, 29 Oct 2004 18:45:20 +0900, leon breedt wrote in [ruby-talk:118234]: > module X > class TestFile < ::File > def initialize > $stderr.puts self.path > end > end > end > f = X::TestFile.new Should it return Qnil or raise an exception? Index: file.c =================================================================== RCS file: /cvs/ruby/src/ruby/file.c,v retrieving revision 1.189 diff -U2 -p -d -r1.189 file.c --- file.c 23 Oct 2004 15:40:58 -0000 1.189 +++ file.c 29 Oct 2004 10:02:09 -0000 @@ -139,4 +139,7 @@ rb_file_path(obj) fptr = RFILE(rb_io_taint_check(obj))->fptr; + if (!fptr) { + rb_raise(rb_eIOError, "uninitialized stream"); + } if (!fptr->path) return Qnil; return rb_tainted_str_new2(fptr->path); -- Nobu Nakada