From: Nobuyoshi Nakada Date: 2010-02-27T09:43:05+09:00 Subject: [ruby-dev:40510] Re: [Bug #1582] IO.new Raises Other Errors between 1.8 and 1.9 なかだです。 At Sat, 27 Feb 2010 01:45:54 +0900, Motohiro KOSAKI wrote in [ruby-dev:40509]: > すいません、regressionは言い過ぎというか間違っていて修正不十分ぐらいが適当でした。 > まず、Linuxでは以下の結果になります。 > > % ./ruby -e 'f1 = File.open("foo.txt", "w"); f1.puts "foo"; f2 = IO.new(f1.fileno); p f2.gets' > -e:1:in `gets': not opened for reading (IOError) > from -e:1:in `
' > > % ./ruby -e 'f1 = File.open("foo.txt", "w"); f1.puts "foo"; f2 = IO.new(f1.fileno, "r"); p f2.gets' > -e:1:in `initialize': Invalid argument (Errno::EINVAL) > from -e:1:in `new' > from -e:1:in `
' 1.8までと動作を合わせてあります。 > http://doc.okkez.net/static/191/class/IO.html をみると > > new(fd, mode = "r") -> IO 1.9のrdocではmodeのデフォルト値についての記述は削られています。 > これは意図的でしょうか?意図したものである場合、ドキュメントの修正をご検討くださいませ 1.8までのドキュメントのバグだと思います。 -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦