You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
child_process instance set encoding will trigger exception #18969
buffer.js:475
throw new errors.TypeError(
^
TypeError [ERR_INVALID_ARG_TYPE]: The "list" argument must be one of type Array, Buffer, or Uint8Array
at Function.concat (buffer.js:475:13)
at ChildProcess.exithandler (child_process.js:259:23)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:159:13)
at Pipe._handle.close [as _onclose] (net.js:568:12)
It's cp bug.
cp have not checked the stdout or stderr encoding changed, cp decide by options.encoding to use stdout or Buffer.concat it.when encoding change to utf-8, the Buffer.concat will failed.
Activity
xqin commentedon Feb 24, 2018
code
killagu commentedon Feb 24, 2018
It's cp bug.
cp have not checked the stdout or stderr encoding changed, cp decide by options.encoding to use stdout or
Buffer.concatit.when encoding change to utf-8, theBuffer.concatwill failed.I will raise a PR to fix it.
hstarorg commentedon Feb 27, 2018
@killagu Please see this, whether need bind listener on stdout and stderr when user not pass the callback param. The source code at: https://github.com/nodejs/node/blob/master/lib/child_process.js#L322-L358
killagu commentedon Feb 27, 2018
@hstarorg It should in another issue. One pr resolve one problem.
hstarorg commentedon Feb 27, 2018
@killagu OK, Thanks.
child_process: fix exec set stdout.setEncoding
child_process: fix exec set stdout.setEncoding
child_process: fix exec set stdout.setEncoding