Skip to content
Browse files

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

  • Loading branch information...
1 parent b5f7c9c commit 3d0630f60b1b74e14178c6865fd6ad64f817f5ef @raggi raggi committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rack/rewindable_input.rb
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)
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

0 comments on commit 3d0630f

Please sign in to comment.
Something went wrong with that request. Please try again.