Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
IO.read fails to read piped commands. It works fine in JRuby 1.6.7.2 and MRI, but is broken in 1.7.0-preview1 and the latest preview2 snapshot.
Expected (JRuby 1.6.7.2):
irb(main):001:0> IO.read("|echo hi") => "hi\n"
Actual (jruby 1.7.0.preview2.dev (1.9.3p203) 2012-08-02 4cdee37 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_05-b05 [linux-amd64]):
irb(main):001:0> IO.read("|echo hi") TypeError: can't convert Hash into String from org/jruby/RubyKernel.java:325:in `open' from org/jruby/RubyIO.java:3615:in `read' from org/jruby/RubyIO.java:3712:in `read' from (irb):1:in `evaluate'
Fixed in commit 158ed61. We were calling 1.8 popen instead of 1.9 popen.