[issue5673] Add timeout option to subprocess.Popen

2013-11-18 Thread Thomas Guettler
Thomas Guettler added the comment: For Python 2.x there is a backport of the subprocess module of 3.x: https://pypi.python.org/pypi/subprocess32. It has the timeout argument for call() and pipe.wait(). -- ___ Python tracker rep...@bugs.python.org

[issue5673] Add timeout option to subprocess.Popen

2011-04-10 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: Thanks for fixing the negative timeout issue. I assumed incorrectly that a negative timeout would cause it to check and return immediately if it would otherwise block. As for the docs, the 3.2/3.3 issue was fixed in [[72e49cb7fcf5]]. I just

[issue5673] Add timeout option to subprocess.Popen

2011-04-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I fixed a bug in _communicate_with_poll(): raise an error if the endtime-time() is negative. If poll() is called with a negative timeout, it blocks until it gets an event. New changeset 3664fc29e867 by Victor Stinner in branch

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: I updated and committed the patch to the cpython hg repo in revision [c4a0fa6e687c]. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Sridhar Ratnakumar
Sridhar Ratnakumar sridh...@activestate.com added the comment: On 2011-03-14, at 9:18 AM, Reid Kleckner wrote: I updated and committed the patch to the cpython hg repo in revision [c4a0fa6e687c]. Does this go to the main branch (py3.3) only? It is not clear from just looking at

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: On Mon, Mar 14, 2011 at 12:31 PM, Sridhar Ratnakumar rep...@bugs.python.org wrote: Sridhar Ratnakumar sridh...@activestate.com added the comment: On 2011-03-14, at 9:18 AM, Reid Kleckner wrote: I updated and committed the patch to the cpython

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Changes by Reid Kleckner r...@mit.edu: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Sridhar Ratnakumar
Changes by Sridhar Ratnakumar sridh...@activestate.com: Removed file: http://bugs.python.org/file21121/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___

[issue5673] Add timeout option to subprocess.Popen

2011-01-06 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: Pablo, so if I understand the issue you've run into correctly, you are using shell redirection to redirect stdout to a file, and then attempting to read from it using stdout=subprocess.PIPE. It seems to me like this behavior is expected, because

[issue5673] Add timeout option to subprocess.Popen

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2010-12-07 Thread Pablo Bitton
Pablo Bitton pablo.bit...@gmail.com added the comment: Has anybody had a chance to look into the problem I encountered yet? Do you need more information? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673

[issue5673] Add timeout option to subprocess.Popen

2010-09-20 Thread Pablo Bitton
Pablo Bitton pablo.bit...@gmail.com added the comment: Has anybody had a chance to look into the problem I encountered yet? Do you need more information? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673

[issue5673] Add timeout option to subprocess.Popen

2010-09-20 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: No, sorry, I just haven't gotten around to reproducing it on Linux. And I've even needed this functionality in the mean time, and we worked around it with the standard alarm trick! =/ -- ___ Python

[issue5673] Add timeout option to subprocess.Popen

2010-08-10 Thread Pablo Bitton
Pablo Bitton pablo.bit...@gmail.com added the comment: I reproduced the problem with the latest patch, subprocess-timeout-py3k-v7.patch, on py3k on Linux. Attached is the code to reproduce the problem and the resulting traceback. -- Added file: http://bugs.python.org/file18468/tcpdump

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Pablo Bitton
Pablo Bitton pablo.bit...@gmail.com added the comment: I've been using the subprocess-timeout-v5.patch patch with 2.x. Isn't that version supposed to work with 2.x? Other than the stated problem, the patched module generally works, and is very helpful. --

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Tim Golden
Changes by Tim Golden m...@timgolden.me.uk: -- nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: I've been using the subprocess-timeout-v5.patch patch with 2.x. Isn't that version supposed to work with 2.x? Actually, yes, so I was wrong at first. The v5 patch will work with 2.x, but that's not the most up to date or correct patch. This

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton
Changes by Pablo Bitton pablo.bit...@gmail.com: -- nosy: +Pablo.Bitton ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton
Pablo Bitton pablo.bit...@gmail.com added the comment: I'd like to report a problem I encountered with the discussed use pattern using subprocess-timeout-v5.patch on linux. I don't have python3 installed at work, sorry. When running: p = subprocess.Popen(tcpdump -i eth0 file ,

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: I don't have python3 installed at work, sorry. Does that mean you have been using the patch with 2.x? If so, that's not valid. -- ___ Python tracker rep...@bugs.python.org

[issue5673] Add timeout option to subprocess.Popen

2010-07-23 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: On Thu, Jul 22, 2010 at 9:05 AM, Alexander Belopolsky rep...@bugs.python.org wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: The documentation should mention somewhere that timeout can be a float.  For example,

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Matthieu Labbé
Changes by Matthieu Labbé bugs.python@mattlabbe.com: -- nosy: +matthieu.labbe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: The documentation should mention somewhere that timeout can be a float. For example, as in time.sleep docstring: sleep(seconds) Delay execution for a given number of seconds. The argument may be a

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: s/Note that a result Fraction/Note that as a result, Fraction/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +gd2shoe, ragnar ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2010-07-21 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: When I ported the patch I tested on trunk + Windows to py3k, I messed that stuff up. I also had to fix a bunch of str vs. bytes issues this time around. On Windows, it uses TextIOWrapper to do the encoding, and on POSIX it uses os.write, so I

[issue5673] Add timeout option to subprocess.Popen

2010-07-21 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: Looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2010-07-20 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: You forgot self. on at least lines 1042 and 1044 in Lib/subprocess.py -- multiple test failures occur on Windows 7 due to a NameError for the global stdout_thread not being defined. It seems self. would also be needed on 1049 and 1053, but beyond

[issue5673] Add timeout option to subprocess.Popen

2010-07-20 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: Uh oh, that was one of the fixes I made when I tested it on Windows. I may have failed to pick up those changes when I ported to py3k. I'll check it out tonight. -- ___ Python tracker

[issue5673] Add timeout option to subprocess.Popen

2010-07-17 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: I don't imagine this is going into 2.7.0 at this point, so I ported the patch to py3k. I also added support to check_output for the timeout parameter and added docs for all of the methods/functions that now take a timeout in the module. The

[issue5673] Add timeout option to subprocess.Popen

2010-07-16 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: I forgot that I had to tweak the test as well as subprocess.py. I did a .replace('\r', ''), but universal newlines is better. Looking at the open questions I had about the Windows threads, I think it'll be OK if the user follows the pattern of:

[issue5673] Add timeout option to subprocess.Popen

2010-07-16 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: The pattern you mention should probably be documented as an example, if that's how we intend for people to use it. Other than that, I've got nothing else here. -- assignee: - rnk ___ Python tracker

[issue5673] Add timeout option to subprocess.Popen

2010-07-14 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: I went through the trouble of building and testing Python on Windows Vista, and with some small modifications I got the tests I added to pass. Here's an updated patch. I'm still not really sure how those threads work on Windows, so I'd rather

[issue5673] Add timeout option to subprocess.Popen

2010-07-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2010-07-14 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: I'm looking into the TODO details right now, but the patch as-is didn't pass for me. The last line of test_communicate_timeout fails on Windows 7 with pineapple\r\npear\r\n not matching pineapple\npear\n. Creating the Popen object with

[issue5673] Add timeout option to subprocess.Popen

2010-07-01 Thread Dave Malcolm
Dave Malcolm dmalc...@redhat.com added the comment: The patch has bitrotted somewhat; I've had a go at reworking it so it applies against the latest version of trunk (r82429). All tests pass (or are skipped) on this x86_64 Linux box --with-pydebug (Fedora 13) There are still some TODOs in

[issue5673] Add timeout option to subprocess.Popen

2010-05-29 Thread Filippo Giunchedi
Changes by Filippo Giunchedi fgiunch...@gmail.com: -- nosy: +filippo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2010-02-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I agree. Does subprocess.TimeoutExpired sound good? Yes. It won't be possible with the current implementation to put the partial output in the exception, because read blocks. Fair enough :) I think call and check_call should clean up

[issue5673] Add timeout option to subprocess.Popen

2010-02-01 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: - why do you say Thread.join() uses a busy loop? is it because it uses Condition.wait()? If so, this will be solved in py3k by issue7316 (which you are welcome to review). Otherwise, I think there should be an upper bound on the sleeping

[issue5673] Add timeout option to subprocess.Popen

2010-01-28 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +astrand stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___

[issue5673] Add timeout option to subprocess.Popen

2010-01-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Some comments: - why do you say Thread.join() uses a busy loop? is it because it uses Condition.wait()? If so, this will be solved in py3k by issue7316 (which you are welcome to review). Otherwise, I think there should be an upper bound on the

[issue5673] Add timeout option to subprocess.Popen

2010-01-27 Thread Senthil Kumaran
Changes by Senthil Kumaran orsent...@gmail.com: -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2009-12-15 Thread Lev Shamardin
Changes by Lev Shamardin shamar...@gmail.com: -- nosy: +abbot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list mailing

[issue5673] Add timeout option to subprocess.Popen

2009-11-17 Thread Thomas Guettler
Changes by Thomas Guettler guet...@thomas-guettler.de: -- nosy: +guettli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2009-07-27 Thread Sridhar Ratnakumar
Changes by Sridhar Ratnakumar sridh...@activestate.com: -- nosy: +srid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___ Python-bugs-list

[issue5673] Add timeout option to subprocess.Popen

2009-07-27 Thread Sridhar Ratnakumar
Sridhar Ratnakumar sridh...@activestate.com added the comment: See http://code.google.com/p/python-process/ for some ideas. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.2 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___ ___

[issue5673] Add timeout option to subprocess.Popen

2009-04-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I think taking this to python-ideas to discuss the API (and the implementation) would be the best way forward. You can probably get help on the Windows stuff there, too. You are also going to need unit tests. -- nosy:

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
New submission from Reid Kleckner r...@mit.edu: I was looking for a way to run a subprocess with a timeout. While there are a variety of solutions on Google, I feel like this functionality should live in the standard library module. Apparently Guido thought this would be good in 2005 but no

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' billiej...@users.sourceforge.net: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5673 ___

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: Ugh. I made the assumption that there must be some natural and easy way to wait for a child process with a timeout in C, and it turns out it's actually a hard problem, which is why this isn't already implemented. So my initial hack for solving this

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
Reid Kleckner r...@mit.edu added the comment: I'd like some feedback on this patch. Is the API acceptable? Would it be better to throw an exception in wait() instead of returning None? What should communicate() return if it times out? I can't decide if it should try to return partial