Win32console and open3 incompatibility

Hi group,

A prize (or at least a big thank you) to anyone who can tell me why
commenting in the 2nd line stops anything from being output.

require ‘open3’
#require ‘win32console’

Open3.popen2(‘svn info’) do |stdin, stdout, wait_thr|
stdout.each do |line|
puts line
end
end

Extra bonus points will be awarded if you tell me how to fix it :slight_smile:

Cheers,
James

-----Original Message-----
From: James F. [mailto:[email protected]]
Sent: 02 February 2012 14:51
To: ruby-talk ML
Subject: win32console and open3 incompatibility

Hi group,

A prize (or at least a big thank you) to anyone who can tell me why
commenting in the 2nd line stops anything from being output.

require ‘open3’
#require ‘win32console’

Open3.popen2(‘svn info’) do |stdin, stdout, wait_thr|
stdout.each do |line|
puts line
end
end

Extra bonus points will be awarded if you tell me how to fix it :slight_smile:

Cheers,
James

Just came back to this and was able to workaround it by commenting out
the line ‘opts[:in] = in_r’ in popen2. I don’t really understand this
area, but am recording my ‘fix’ for posterity :slight_smile:

I’m the “posterity” :wink: - Your fix was a big help for me! (used it in
#popen3)

Axel