aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 13:17:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-17 13:17:49 +0000
commitcb0d480532c416ca6db0ca4d0ec8c0461b58f84c (patch)
tree53f389cbfa569f810338fa6899fd4161ca6e6de4
parentda74f0f426072e97fee3494fbe9691e59bdf860b (diff)
downloadruby-cb0d480532c416ca6db0ca4d0ec8c0461b58f84c.tar.gz
* 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
-rw-r--r--ChangeLog4
-rw-r--r--lib/open-uri.rb6
2 files changed, 9 insertions, 1 deletions
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 <akr@fsij.org>
+
+ * lib/open-uri.rb: call io.close! for Tempfile.
+
Tue Jul 17 16:41:32 2012 NARUSE, Yui <naruse@ruby-lang.org>
* 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