Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit dfb8aeaab1a86f3a85e9a514c351e1888b3cff56 1 parent bf4593a
James Tucker raggi authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/rack/rewindable_input.rb
3  lib/rack/rewindable_input.rb
View
@@ -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.