Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use ::File.unlink in place of Tempfile#unlink to avoid 1.9.1 bug

  • Loading branch information...
commit 3d0630f60b1b74e14178c6865fd6ad64f817f5ef 1 parent b5f7c9c
@raggi raggi authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/rack/rewindable_input.rb
View
3  lib/rack/rewindable_input.rb
@@ -77,7 +77,8 @@ def make_rewindable
@rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
@rewindable_io.binmode
if filesystem_has_posix_semantics?
- @rewindable_io.unlink
+ # Use ::File.unlink as 1.9.1 Tempfile has a bug where unlink closes the file!
+ ::File.unlink @rewindable_io.path
raise 'Unlink failed. IO closed.' if @rewindable_io.closed?
@unlinked = true
end
Please sign in to comment.
Something went wrong with that request. Please try again.