6 ms·
> Python will turn off line buffering when it detects it's not talking to a tty Okay, I’ve been running into a bug in one of my Rust programs and I think this
by css 5y ago
> Python will turn off line buffering when it detects it's not talking to a tty
Okay, I’ve been running into a bug in one of my Rust programs and I think this comment has the answer. My program uses a Command [0] to listen to stdin and stdout. Theoretically that Command should terminate when the parent process dies, but if the Command is a Python script that doesn’t include a `print()` with `flush=True`, it doesn’t die. I think you might have found my problem for me.
[0]: https://docs.rs/tokio/1.15.0/tokio/process/struct.Command.html https://docs.rs/tokio/1.15.0/tokio/process/struct.Command.ht...