Project

General

Profile

Backport #3149

Mac OS X の ruby 1.9.1p378 で再 open 後 delete した Tempfile が closed stream になる

Added by znz (Kazuhiro NISHIYAMA) about 9 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-

Description

=begin
[ruby-dev:40992] は trunk だと r24662 で修正されているようなので Backport リクエストとしてチケットを登録しておきます。

At Thu, 15 Apr 2010 10:42:47 +0900,
KISHIMOTO, Makoto wrote:

きしもとです

trunk に残っているかどうかわかりませんが、MacPorts の ruby 1.9 で
以下のようなバグを確認しました。(ruby 1.8 ではエラーにならないので
バグだと思います)

$ ruby1.9 -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10]

$ cat hoge.rb
require 'tempfile'

tempfile = Tempfile.open "hoge"
tempfile.write "hoge\n"
tempfile.close
tempfile.open
tempfile.delete
print tempfile.read

$ ruby1.9 hoge.rb
hoge.rb:8:in `read': closed stream (IOError)

=end

Associated revisions

Revision 4e887359
Added by yugui (Yuki Sonoda) about 9 years ago

merges r24662 from trunk into ruby_1_9_1. This fixes #3149.

  • lib/tempfile.rb (Tempfile#unlink): reverted r23494, since the usage in RubyInline is considered wrong.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@27598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by yugui (Yuki Sonoda) about 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r27598.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF