Skip to content

JRuby 1.7.8 (1.9) Open3 capture3 bug #1290

Closed
@slippycheeze

Description

@slippycheeze

The newest version of JRuby fixes the old issue where popen3 would not pass a status object to the block, which is awesome. Unfortunately, while this makes capture3 run, it is not quite correct:

jruby-1.7.8 :001 > require 'open3'
 => true
jruby-1.7.8 :002 > Open3.capture3('echo')
 => ["{}\n", "", #]
jruby-1.7.8 :003 > Open3.capture3('echo', :foo => :bar)
 => ["{:foo=>:bar}\n", "", #]

As you will observe, the output includes a stringified hash, which is the "options" part of handling the thing. It seems like your IO::popen3 implementation should either handle those appropriately, or you should move the "RUBY_ENGINE" part down below the "if Hash === cmd.last" part to handle (by ignoring) the options passed. :)

Another option, perhaps better, might be to go down and implement popen_run instead of popen3, which is invoked by the rest of the methods to handle the actual I/O process.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions