[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2019-06-30 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.run timeout does not function if shell=True and capture_output=True ___ Python tracker

[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2019-06-27 Thread haizaar
Change by haizaar : -- nosy: +haizaar ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2017-04-24 Thread Martin Panter
Martin Panter added the comment: This is similar to the problem described in Issue 26534, which proposes “kill_group” and “killpg” APIs as a solution. (FYI you should put a shebang at the start of the shell script, or call it as “sh -c test.sh”, to fix the “Exec format error”.) --

[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2017-04-24 Thread Martijn Pieters
Martijn Pieters added the comment: Apologies, I copied the wrong sleep 10 demo. The correct demo is: cat >test.sh< #!/bin/sh > sleep 10 > EOF time bin/python -c "import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE, timeout=3)" Traceback (most recent call last): File

[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2017-04-24 Thread Martijn Pieters
New submission from Martijn Pieters: You can't time out a process tree that includes a never-ending process, *and* which redirects stderr: cat >test.sh< /dev/null # never-ending EOF chmod +x test.sh python -c "import subprocess; subprocess.run(['./test.sh'], stderr=subprocess.PIPE,