[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-10-01 Thread STINNER Victor
STINNER Victor added the comment: > I'm still seeing hangs with subprocess.run() in Python 3.7.4 That's not surprising, the fix has been pushed at 2019-09-11. Python 3.7.5 will include the fix and it will be released soon: https://www.python.org/dev/peps/pep-0537/ --

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-10-01 Thread Tony Cappellini
Tony Cappellini added the comment: Using Python 3.7.4, I'm calling subprocess.run() with the following arguments. .run() still hangs even though a timeout is being passed in. subprocess.run(cmd_list, stdout=subprocess.PIPE,

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-10-01 Thread Tony Cappellini
Tony Cappellini added the comment: I'm still seeing hangs with subprocess.run() in Python 3.7.4 Unfortunately, it involves talking to an NVME SSD on Linux, so I cannot easily submit code to duplicate it. -- nosy: +cappy ___ Python tracker

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-17 Thread STINNER Victor
STINNER Victor added the comment: > On Windows, the following pattern _can_ hang: (...) I created bpo-38207 "subprocess: On Windows, Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe" to track this issue. --

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks. I believe this issue is fixed but you've identified follow-on issues. lets follow up on those in their own bugs. -- resolution: -> fixed stage: patch review -> commit review status: open -> closed ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread STINNER Victor
STINNER Victor added the comment: On Windows, the following pattern _can_ hang: proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) try: return proc.communicate(timeout=1.0) except TimeoutExpired: proc.kill() return proc.communicate() # <== HERE Even if the first child process is

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread miss-islington
miss-islington added the comment: New changeset 5fe153c21de020f37712910b0dcce93341bba272 by Miss Islington (bot) in branch '3.7': bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490) https://github.com/python/cpython/commit/5fe153c21de020f37712910b0dcce93341bba272

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread miss-islington
miss-islington added the comment: New changeset 872c85a1796290baef89a20dbde819c4da45830c by Miss Islington (bot) in branch '3.8': bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490) https://github.com/python/cpython/commit/872c85a1796290baef89a20dbde819c4da45830c

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread miss-islington
Change by miss-islington : -- pull_requests: +15539 pull_request: https://github.com/python/cpython/pull/15898 ___ Python tracker ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread miss-islington
Change by miss-islington : -- keywords: +patch pull_requests: +15538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15897 ___ Python tracker ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-09-11 Thread Thomas Wouters
Thomas Wouters added the comment: New changeset 580d2782f70f8e0bed7ec20abb03d740cb83b5da by T. Wouters (Gregory P. Smith) in branch 'master': bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-07-04 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith resolution: duplicate -> status: closed -> open ___ Python tracker ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-07-04 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: resolved -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: Issue 30154 that I've marked as a duplicate demonstrates this problem without using shell=True. The solution I proposed handles that via the additional small timeout on the cleanup side, but still has the caveat that the grandchild processes keep running

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-30 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +14307 pull_request: https://github.com/python/cpython/pull/14490 ___ Python tracker ___

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-27 Thread haizaar
haizaar added the comment: Thanks for looking at it. My original code had "tar" running, which is a child of the shell as well... I assume running exec in the shell may help somewhat, but not a cure obviously. I'm all for killing the process group. "Run something and get it's about" should

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-27 Thread Martin Panter
Martin Panter 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

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-27 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: On mac this exits immediately with 0.1 seconds as timeout but reproducible on Ubuntu with master. -- nosy: +gregory.p.smith, xtreak ___ Python tracker

[issue37424] subprocess.run timeout does not function if shell=True and capture_output=True

2019-06-27 Thread haizaar
New submission from haizaar : Consider the following: subprocess.run('sleep 10', shell=True, timeout=.1, capture_output=True) It should raise after 0.1 seconds, but it does not - it waits 10 seconds till sleep finishes and only then raises "subprocess.TimeoutExpired: Command 'sleep 10'