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

execSync not allow encoding to set explicitly to buffer #6930

Closed
zhanzhenzhen opened this issue May 23, 2016 · 1 comment
Closed

execSync not allow encoding to set explicitly to buffer #6930

zhanzhenzhen opened this issue May 23, 2016 · 1 comment
Labels
child_process Issues and PRs related to the child_process subsystem.

Comments

@zhanzhenzhen
Copy link
Contributor

  • Version: Tested on 5, 6
  • Platform: Tested on OS X, Ubuntu
  • Subsystem:
> child_process.execSync("ls",{encoding:"buffer"})
TypeError: Unknown encoding: buffer
@addaleax addaleax added the child_process Issues and PRs related to the child_process subsystem. label May 23, 2016
@cjihrig
Copy link
Contributor

cjihrig commented May 23, 2016

Verified the issue.

One fix is cjihrig@ffb370f. Another fix would be supporting 'buffer' encoding in Buffer.prototype.toString().

EDIT: I'm not sure if the toString() approach makes sense though, as it would be giving back a Buffer, not a string.

Fishrock123 pushed a commit to Fishrock123/node that referenced this issue May 30, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: nodejs#6930
PR-URL: nodejs#6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
rvagg pushed a commit that referenced this issue Jun 2, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 11, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 11, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 12, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 12, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 14, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this issue Jul 14, 2016
When the 'buffer' encoding is passed to spawnSync(), an exception
is thrown in Buffer's toString() method because 'buffer' is not
a valid encoding there. This commit special cases the 'buffer'
encoding.

Fixes: #6930
PR-URL: #6939
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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.
Projects
None yet
Development

No branches or pull requests

3 participants