Project

General

Profile

Actions

Bug #10859

closed

Process.spawn raises TypeError when passing hash with symbols as env

Added by bubo47 (Jakub Jursa) almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-02-17 trunk 49623) [x86_64-linux]
[ruby-core:68146]

Description

expected:

head :001 > Process.spawn({FOO: "bar"}, "bash")
 => 13479 

got in reality:

head :001 > Process.spawn({FOO: "bar"}, "bash")
TypeError: no implicit conversion of Symbol into String
...

when I pass {"FOO" => "bar"} as first parameter, everything works as expected. It would be nice though to have possibility to pass Hash with symbols as parameter (or, at least mention in documentation http://ruby-doc.org//core-2.2.0/Process.html#method-c-spawn that env hash cannot have symbols as keys)

Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49635.


[DOC] ENV keys must be strings [ci skip]

  • hash.c (env_aset): state that ENV keys must be strings.

  • process.c (rb_f_spawn): ditto. [ruby-core:68146] [Bug #10859]

Actions

Also available in: Atom PDF

Like0
Like0