From 18052364ce83fb4760b759553e75bcea1969ecb2 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 9 May 2018 20:42:31 +0200 Subject: [PATCH] process: provide dummy stdio for non-console Windows apps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only known condition where we could not provide appropriate stdio streams so far were non-console Windows applications. Since this issue has come up a few times in our issue tracker now, switch to providing dummy streams for these cases instead. If there are other valid cases in which `uv_guess_handle` fails, and where there is a more sensible way to provide stdio, we’ll probably still find out because the streams don’t work properly either way. Refs: https://github.com/nodejs/help/issues/1251 PR-URL: https://github.com/nodejs/node/pull/20640 Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Ben Noordhuis Reviewed-By: Luigi Pinca --- doc/api/errors.md | 36 +++++++++++++++++++------------ lib/internal/errors.js | 3 --- lib/internal/process/stdio.js | 28 ++++++++++++++++-------- test/parallel/test-dummy-stdio.js | 27 +++++++++++++++++++++++ 4 files changed, 68 insertions(+), 26 deletions(-) create mode 100644 test/parallel/test-dummy-stdio.js diff --git a/doc/api/errors.md b/doc/api/errors.md index f504acd8c02a8f..68e6955925c117 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1810,20 +1810,6 @@ An attempt was made to load a module with an unknown or unsupported format. An invalid or unknown process signal was passed to an API expecting a valid signal (such as [`subprocess.kill()`][]). - -### ERR_UNKNOWN_STDIN_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdin` file -type. This error is usually an indication of a bug within Node.js itself, -although it is possible for user code to trigger it. - - -### ERR_UNKNOWN_STREAM_TYPE - -An attempt was made to launch a Node.js process with an unknown `stdout` or -`stderr` file type. This error is usually an indication of a bug within Node.js -itself, although it is possible for user code to trigger it. - ### ERR_V8BREAKITERATOR @@ -2080,6 +2066,28 @@ kind of internal Node.js error that should not typically be triggered by user code. Instances of this error point to an internal bug within the Node.js binary itself. + +### ERR_UNKNOWN_STDIN_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdin` file +type. This error is usually an indication of a bug within Node.js itself, +although it is possible for user code to trigger it. + + +### ERR_UNKNOWN_STREAM_TYPE + + +An attempt was made to launch a Node.js process with an unknown `stdout` or +`stderr` file type. This error is usually an indication of a bug within Node.js +itself, although it is possible for user code to trigger it. + ### ERR_VALUE_OUT_OF_RANGE