deno icon indicating copy to clipboard operation
deno copied to clipboard

Deno.command spawn stdout hangs on read

Open caperaven opened this issue 11 months ago • 5 comments

deno 1.41.1 (release, x86_64-pc-windows-msvc) v8 12.1.285.27 typescript 5.3.3

I am trying to run a python command "python ...path/file.py" I need to read the response to see if it started up correctly.

From deno.

const command = new Deno.Command(this.#command, {
    args: this.#args,
    stdout: "piped"
});

this.#childProcess = await command.spawn();
const success = await read_stdout(this.#childProcess);

in read_stdout I have this

const decoder = new TextDecoder();
const reader = process.stdout.getReader();
const read_value = (await reader.read()).value;
const text = decoder.decode(read_value);

but on the reader.read it just hangs for ever

caperaven avatar Mar 07 '24 11:03 caperaven