-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.M-processModule: tokio/processModule: tokio/process
Description
Version
tokio v1.18.2
Toolchains
cargo 1.60.0 (d1fd9fe2c 2022-03-01)
cargo 1.62.0-nightly (a44758ac8 2022-05-04)
Platform
Windows 11
Description
I cannot spawn any tokio::process::Comand
with a piped stdin in the Nightly toolchain.
I tried this code:
use tokio::process::Command;
use std::process::Stdio;
#[tokio::main]
async fn main() {
Command::new("cmd")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap();
}
I did not expect any output because it's being spawned.
Running on the stable toolchain:
Instead, when running with the nightly toolchain, it throws this error:
If I make it inherit stdin (default behavior):
Command::new("cmd")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap();
It will run just fine in the nightly toolchain:
Am I missing something maybe ? 🤔
Thanks!
Metadata
Metadata
Assignees
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.M-processModule: tokio/processModule: tokio/process