Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.6.5
-
Fix Version/s: JRuby 1.7.4
-
Component/s: Standard Library
-
Labels:None
-
Environment:Mac OSX.
-
Number of attachments :
Description
It appears Open3.popen3(...) is broken on JRuby in 1.9 mode.
On 1.8.7, it returns three arguments (stdin, stdout, and stderr).
On 1.9.X, it returns (stdin, stdout, stderr, and a thread).
You can use the thread argument to access a Process::Status object,
and the PID of the spawned command.
To reproduce:
stdin, stdout, stderr, thr = Open3.popen3 "ls"
thr.value # => NoMethodError (called on nil)
Thanks!
Issue Links
- is duplicated by
-
JRUBY-6966
Open3.popen3 does not take optional environment hash as first argument
-
-
JRUBY-6539
IO.capture3 in 1.9 mode fails with nil.value call
-
Activity
Hiro Asari
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Priority | Major [ 3 ] | Critical [ 2 ] |
Hiro Asari
made changes -
| Link |
This issue is duplicated by |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.7.1 [ 18842 ] |
Hiro Asari
made changes -
| Link | This issue is duplicated by JRUBY-6966 [ JRUBY-6966 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.2 [ 19008 ] | |
| Fix Version/s | JRuby 1.7.1 [ 18842 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.3 [ 19009 ] | |
| Fix Version/s | JRuby 1.7.2 [ 19008 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.4 [ 19106 ] | |
| Fix Version/s | JRuby 1.7.3 [ 19009 ] |
I note here that Open3::popen3 has a short circuit that returns IO::open3 for JRuby (https://github.com/jruby/jruby/blob/3b60780b07e8dc5e480987357098756bd281ddf0/lib/ruby/1.9/open3.rb#L74).
It was not immediately obvious to me how we might reconcile this with IO::open3 alone. We can get the child Java Process easily, but it seemed nontrivial to build a RubyThread from it.