diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/open-uri.rb | 6 |
2 files changed, 9 insertions, 1 deletions
@@ -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 |