Martin Panter <vadmium...@gmail.com> added the comment: Same thing going on as in Issue 30154. The shell is probably spawning the “sleep” command as a child process (grandchild of Python), and waiting for it to exit. When Python times out, it will kill the shell process, leaving the grandchild as an orphan. The “sleep” process will still be running and probably holds the “stdout” and/or “stderr” pipes open, and Python will wait indefinitely to be sure it has captured all the output to those pipes.
Also see Issue 26534 proposes APIs to kill a process group rather than the single child process. ---------- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37424> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com