-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Description
Hi.
I was experimenting with child_process.spawn(stdio=...) (https://nodejs.org/api/child_process.html#child_process_options_stdio) while invoking PythonShell.run() and I got the following crash:
TypeError: Cannot read property 'setEncoding' of null
at ...\node_modules\python-shell\index.js:63:35
How I called PythonShell
PythonShell.run(scriptPath, {
pythonPath: ...,
pythonOptions: ['-u'],
mode: 'text',
stdio: ['ignore', process.stdout, process.stderr],
args: ...
}
So, I just wanted to stream all stdout/stderr to my terminal, bypassing any parsing by PythonShell or whatever.
The stdio options are passed to child_process and cause the stdout and stderr streams never to be set on the childProcess object. Therefore all placesin python-shell/index.js that access this.stdout/stderr need a null check.
Thank you.