[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2021-02-27 Thread Eryk Sun
Eryk Sun added the comment: Issue 37424 fixed this for Python 3.7+ in POSIX. It's still broken in Windows, for which I'm leaving issue 31447 open. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: -> subprocess.run timeout does not function i

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-14 Thread Eryk Sun
Eryk Sun added the comment: Work on related issues extends back 9 years to issue 5115. Also see issue 26534. -- nosy: +eryksun ___ Python tracker ___ __

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-14 Thread Fangyi Zhou
Fangyi Zhou added the comment: I choose to implement the first way. I believe this is in favour in prevention of resource leaks and zombie processes. https://github.com/python/cpython/pull/5684 -- ___ Python tracker

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-14 Thread Fangyi Zhou
Change by Fangyi Zhou : -- keywords: +patch pull_requests: +5480 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-13 Thread Fangyi Zhou
Fangyi Zhou added the comment: As far as I have discovered, the bash process is killed by after the timeout. Presumably the pipe is still open due to the sleep process, so in order to retrieve any output from stdout/stderr, the read waits on the pipe, hence leading to timeout not respected.

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-13 Thread Fangyi Zhou
Fangyi Zhou added the comment: I think the issue is that the process is not terminated. If you increase the sleep duration, you would see that the sleep process is not killed by SIGKILL. -- nosy: +fangyizhou ___ Python tracker

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-08 Thread Mike Lewis
Mike Lewis added the comment: Example of the output: $ ./timeout.py Subprocess with idle stdout at timeout: start at 1518081130.44 Timed out at: 1518081135.45, 5 seconds Generating stdout from subprocess: start at 1518081135.45 Timed out at: 1518081136.47, 1 seconds As you see, the 1 second

[issue32795] subprocess.check_output() with timeout does not exit if child process does not generate output after timeout

2018-02-08 Thread Mike Lewis
New submission from Mike Lewis : When using a timeout with check_output(), the call does not terminate unless the child process generates output after the timeout. Looking at the code, it appears there is a second call to communicate() after the timeout has happened, presumably to retrieve any