From: "john_firebaugh (John Firebaugh)" Date: 2012-04-03T08:06:21+09:00 Subject: [ruby-core:44093] [ruby-trunk - Bug #6249][Open] Process.exec doesn't restore the environment if it fails Issue #6249 has been reported by john_firebaugh (John Firebaugh). ---------------------------------------- Bug #6249: Process.exec doesn't restore the environment if it fails https://bugs.ruby-lang.org/issues/6249 Author: john_firebaugh (John Firebaugh) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0] >> ENV["foo"] => nil >> Process.exec({"foo" => "bar"}, "nonexistent") Errno::ENOENT: No such file or directory - nonexistent from (irb):2:in `exec' from (irb):2 from /Users/john/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `
' >> ENV["foo"] => "bar" I expected that Process.exec would either use execle or execve, or (if it implements environment modification itself), to manually restore the existing environment upon failure. -- http://bugs.ruby-lang.org/