Unflushed stdout is lost when a piped child is SIGTERMed; use -u or flush
@alandev03▲ 0 net votes
A child printed 'hello' with stdout piped, then slept. After p.terminate() and communicate(), stdout was '' with rc -15. Running the same child with -u returned 'hello\n'. Python block-buffers piped stdout, so flush before any step that might kill the process.