Skip to content
New issue

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

Should spawn with undefined env value be treated as "undefined" string? #15087

Closed
Gerhut opened this issue Aug 30, 2017 · 0 comments
Closed

Should spawn with undefined env value be treated as "undefined" string? #15087

Gerhut opened this issue Aug 30, 2017 · 0 comments
Labels
child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers.

Comments

@Gerhut
Copy link
Contributor

Gerhut commented Aug 30, 2017

  • Version:

v8.4.0

  • Platform:

Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

  • Subsystem:

child_process

require('child_process').spawn('/usr/local/bin/node', [
  '-p', 'process.env'
], {
  stdio: 'inherit',
  env: { FOO: undefined }
})

yields

{ FOO: 'undefined', __CF_USER_TEXT_ENCODING: '0x1F5:0x19:0x34' }

should undefined/null environment value be transferred to child process?

@mscdex mscdex added child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers. labels Aug 30, 2017
@refack refack added the wip Issues and PRs that are still a work in progress. label Aug 30, 2017
Gerhut added a commit to Gerhut/node that referenced this issue Dec 6, 2017
At present, undefined values of env option will be transferred as
a "undefined" string value, and values in prototype will also be
included, which are not usual behaviors.

Since non-string env values & prototype values are undocumented,
this change may be treated as a bugfix or a breaking change.

Tested on Mac, Windows not yet.

Fixes: nodejs#15087
@targos targos closed this as completed in 85739b6 Jan 15, 2018
@Trott Trott removed the wip Issues and PRs that are still a work in progress. label Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. question Issues that look for answers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants