-
-
Notifications
You must be signed in to change notification settings - Fork 939
Closed
Milestone
Description
Process.spawn is supposed to unset environment variables that are explicitly specified as nil. Instead, the environment variable is being set as "". This happens even if the environment variable didn't exist before calling Process.spawn.
Below is a sample script demonstrating the problem:
#!/usr/bin/env ruby
if ARGV.first != "spawned"
Process.wait Process.spawn({ "SHOULD_BE_NIL" => nil }, __FILE__, "spawned")
exit
end
if ENV["SHOULD_BE_NIL"].nil?
puts "success!"
else
puts "failure: #{ENV["SHOULD_BE_NIL"].inspect}"
endWhen run on Ruby 2.2.3 and JRuby 1.7.22, it works as expected... I get success!, but on JRuby 9.0.3.0, I get failure: "".
I'd be happy to work on a fix for this if it hasn't already been solved (I found some similar looking issues open, but couldn't find one that quite matched it).
matthewd
Metadata
Metadata
Assignees
Labels
No labels