Project

General

Profile

Patch #35720

Updated by Mischa The Evil over 2 years ago

after #35539 https://redmine.org/issues/35539 I'm getting failures 

 <pre> 
 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' 
 </pre> 

 _File::BINARY_ flag should be enough to setup a binary mode 

 <pre><code class="diff"> 
 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 
 </code></pre>

Back