@headius I will land a fix today and I hope you can review it because it is ugly. I am hoping on 9k this is a much different fix but on 1.7 we have the CRLF wrapper and we set it in a place where we have no idea about ecflags. So my patch post-processes that wrapping and removes the CRLF wrapper based on ec settings :)
No doubt with fuller port on master we are only failing on master because windows is not hitting native paths. Hopefully, the fix will still be more harmonius...
@enebo Your fix for 1.7 seems "fine" even if it is pretty hacky. I'm going to take a quick look to see if it's possible to propagate ecflags to the place we create CRLF Wrapper but, but I know 1.7 has very weak ecflags processing right now.
@enebo I believe the patch below is a start at propagating ecflags into the actual channel wrapping. We process ecflags as part of the open process, and it's stored in the RubyFile that eventually calls fdopen, so propagating it should work ok here.
Because we can't open a file in text mode on Windows (Java has no such concept) we currently force read/write conversion to use UNIVERSAL_NEWLINE_DECORATOR. Your example, explicitly tries to turn that mode off, but since we're on Windows doing text mode it gets turned back on again.
So we need a way to propagate that universal newlines were explicitly disabled and not turn them on for text mode in that case.