Tempfile#open on windows unconditionally opens in "b" mode messing CRLF logic (--1.9) #3727

Closed
enebo opened this Issue Mar 11, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@enebo
Member

enebo commented Mar 11, 2016

Environment

jruby 1.7.25-SNAPSHOT (1.9.3p551) 2016-03-09 fed46bd on Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02 +jit [Windows 7-amd64]

(works as expected on 9k)

Expected Behavior

require 'tempfile'
f = Tempfile.new("test-truncate")
f.puts "abc"
f.puts "def"
f.close
f.open
f.gets # should == "abc\n"

Actual Behavior

It will f.gets will equal "abc\r\n".

Notes

This occurs multiple times in MRI test suite so I am confident this will get coverage but I will try and remember to add a spec if it is not adequately covered in ruby/spec.

@enebo enebo added this to the JRuby 1.7.25 milestone Mar 11, 2016

enebo added a commit that referenced this issue Mar 11, 2016

@enebo enebo closed this Mar 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment