Feature #4588

exec(env, cmd) fails in Ruby 1.8; works in 1.9

Added by sunaku (Suraj Kurapati) about 1 year ago. Updated 10 months ago.

[ruby-core:35827]
Status:Rejected Start date:04/20/2011
Priority:Normal Due date:
Assignee:knu (Akinori MUSHA) % Done:

0%

Category:core
Target version:Ruby 1.8.7

Description

Passing a hash as the "env" parameter for exec() fails in Ruby 1.8:

# ruby -ve 'exec({"HELLO"=>"WORLD"}, "ruby", "-ve", "puts ENV[%q(HELLO)]")'
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
-e:1:in `exec': can't convert Hash into String (TypeError)
	from -e:1

In contrast, it works correctly in Ruby 1.9:

# ruby -ve 'exec({"HELLO"=>"WORLD"}, "ruby", "-ve", "puts ENV[%q(HELLO)]")'
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
WORLD

Thanks for your consideration.

History

Updated by sunaku (Suraj Kurapati) about 1 year ago

My mistake. I just noticed that Kernel#exec() lacks an "env" parameter in the Ruby 1.8.7 API docs. So this bug report is now a feature request. Sorry for the confusion.

Updated by nobu (Nobuyoshi Nakada) about 1 year ago

  • Tracker changed from Bug to Feature
  • Status changed from Open to Assigned
  • Assignee set to knu (Akinori MUSHA)

Updated by knu (Akinori MUSHA) 10 months ago

  • Status changed from Assigned to Rejected
1.8.7 is legacy and basically feature frozen. If you provide me with a patch I could commit it to ruby_1_8, but there will be no backport to ruby_1_8_7. If it's okay, reopen this issue when the patch is ready.

Also available in: Atom PDF