Project

General

Profile

Actions

Patch #35720

closed

Defect: Binmode specified twice

Added by Pavel Rosický over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

after #35539 I'm getting failures

ArgumentError: binmode specified twice
    app/models/attachment.rb:572:in `initialize'
    app/models/attachment.rb:572:in `open'
    app/models/attachment.rb:572:in `create_diskfile'
    app/models/attachment.rb:142:in `files_to_final_location'

File::BINARY flag should be enough to setup a binary mode

diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index c65c56722..b0b0a02ba 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -572,7 +572,6 @@ class Attachment < ActiveRecord::Base
         File.open(
           File.join(path, name),
           flags: File::CREAT | File::EXCL | File::BINARY | File::WRONLY,
-          binmode: true,
           &block
         )
       rescue Errno::EEXIST

Related issues

Related to Redmine - Defect #35539: Race condition (possible filename collision) in Attachment.disk_filenameClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF