From cb0d480532c416ca6db0ca4d0ec8c0461b58f84c Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 17 Jul 2012 13:17:49 +0000 Subject: [PATCH] * lib/open-uri.rb: call io.close! for Tempfile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ lib/open-uri.rb | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d171954e73..109c73c208 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jul 17 22:17:13 2012 Tanaka Akira + + * lib/open-uri.rb: call io.close! for Tempfile. + Tue Jul 17 16:41:32 2012 NARUSE, Yui * proc.c (rb_proc_arity): return normal value (not -n-1) if it is not diff --git a/lib/open-uri.rb b/lib/open-uri.rb index 6e24b40ba5..d3b26e1277 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -149,7 +149,11 @@ module OpenURI begin yield io ensure - io.close + if io.kind_of? Tempfile + io.close! + else + io.close + end end else io