We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given open3_bug.rb:
open3_bug.rb
require 'shellwords' require 'open3' command = "ruby -e 'puts ARGV.inspect' #{'a[1:1]'.shellescape}" puts `#{command}` Open3.popen3(command) do |_, stdout, stderr| puts stdout.read puts stderr.read end
Notice the different output on JRuby compared to MRI 1.8.7 and 2.2 (suggesting that MRI has always behaved this way):
➜ chruby 1.8.7 ➜ ruby -v open3_bug.rb ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin12.5.0] ["a[1:1]"] ["a[1:1]"] ➜ chruby 2.2 ➜ ruby -v open3_bug.rb ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin12.0] ["a[1:1]"] ["a[1:1]"] ➜ chruby jruby ➜ ruby -v open3_bug.rb jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64] ["a[1:1]"] ["a\\[1:1\\]"]
The escape characters are treated as part of the argument itself when it gets back in ruby on JRuby but not on MRI.
The text was updated successfully, but these errors were encountered:
Works as expected in JRuby 9000, which has completely reimplemented process spawning.
Sorry, something went wrong.
No branches or pull requests
Given
open3_bug.rb
:Notice the different output on JRuby compared to MRI 1.8.7 and 2.2 (suggesting that MRI has always behaved this way):
The escape characters are treated as part of the argument itself when it gets back in ruby on JRuby but not on MRI.
The text was updated successfully, but these errors were encountered: