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

Deno.command spawn stdout hangs on read #22767

Open
caperaven opened this issue Mar 7, 2024 · 0 comments
Open

Deno.command spawn stdout hangs on read #22767

caperaven opened this issue Mar 7, 2024 · 0 comments

Comments

@caperaven
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant