Project

General

Profile

Bug #3215

Updated by jeremyevans0 (Jeremy Evans) about 5 years ago

=begin 
  
  This is with a VS8 compiled version of ruby. 
 
  Given this simple program (foo.rb): 
  ----------->8---------cut--------8<------------ 
  puts "*" * 20 
  p IO.popen('echo HI') {|f| f.readlines} 
  puts "*" * 20 
  ----------->8---------cut--------8<------------ 
 
 
  I get this: 
  ----------->8---------cut--------8<------------ 
  E:\test>bin\ruby.exe foo.rb 
  ******************** 
  The handle is invalid. 
  [] 
  ******************** 
 
  E:\test> 
  ----------->8---------cut--------8<------------ 
 
  Interestingly, if I redirect to a file, it works: 
  ----------->8---------cut--------8<------------ 
  E:\test>bin\ruby.exe foo.rb > q 
 
  E:\test>type q 
  ******************** 
  ["HI\n"] 
  ******************** 
 
  E:\test> 
  ----------->8---------cut--------8<------------ 
 
  I'm not sure what is going on, but I know that the python group had similar problems in python < 2.6.... maybe we can crib their solution? 
 
  Ciao! 
 
  Python URLs: 
    http://bytes.com/topic/python/answers/634409-subprocess-handle-invalid-error 
    http://bugs.python.org/issue1124861 -- The patch is interesting. 
 
 =end 
 

Back