From cc3a818272cdb6bfa9eb728c6c708418aa88c22f Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Fri, 28 Jun 2019 17:20:46 +0200 Subject: [PATCH] Do not set binmode on output temp files This removes binmode so Ruby can do its automatic line ending conversion like it used to. To avoid encoding compatibilities, the encoding on the temp files is set to 8 bit ascii. --- lib/aruba/processes/spawn_process.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/aruba/processes/spawn_process.rb b/lib/aruba/processes/spawn_process.rb index 43efa35b2..f85e6f420 100644 --- a/lib/aruba/processes/spawn_process.rb +++ b/lib/aruba/processes/spawn_process.rb @@ -79,8 +79,10 @@ def start @stdout_file.sync = true @stderr_file.sync = true - @stdout_file.binmode - @stderr_file.binmode + if RUBY_VERSION >= '1.9' + @stdout_file.set_encoding('ASCII-8BIT') + @stderr_file.set_encoding('ASCII-8BIT') + end @exit_status = nil @duplex = true