[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

[issue5673] Add timeout option to subprocess.Popen

2011-04-10 Thread Reid Kleckner
Reid Kleckner 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 added a Misc/NEWS

[issue5673] Add timeout option to subprocess.Popen

2011-04-08 Thread STINNER Victor
STINNER Victor 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 'default': Issue #11757: subproc

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Sridhar Ratnakumar
Changes by Sridhar Ratnakumar : Removed file: http://bugs.python.org/file21121/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Changes by Reid Kleckner : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Reid Kleckner added the comment: On Mon, Mar 14, 2011 at 12:31 PM, Sridhar Ratnakumar wrote: > > Sridhar Ratnakumar 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

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Sridhar Ratnakumar
Sridhar Ratnakumar 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 http://hg.python.org/cpython/rev/c

[issue5673] Add timeout option to subprocess.Popen

2011-03-14 Thread Reid Kleckner
Reid Kleckner added the comment: I updated and committed the patch to the cpython hg repo in revision [c4a0fa6e687c]. -- ___ Python tracker ___ _

[issue5673] Add timeout option to subprocess.Popen

2011-01-06 Thread Reid Kleckner
Reid Kleckner 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 the shell will

[issue5673] Add timeout option to subprocess.Popen

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5673] Add timeout option to subprocess.Popen

2010-12-07 Thread Pablo Bitton
Pablo Bitton added the comment: Has anybody had a chance to look into the problem I encountered yet? Do you need more information? -- ___ Python tracker ___

[issue5673] Add timeout option to subprocess.Popen

2010-09-20 Thread Reid Kleckner
Reid Kleckner 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 tracker

[issue5673] Add timeout option to subprocess.Popen

2010-09-20 Thread Pablo Bitton
Pablo Bitton added the comment: Has anybody had a chance to look into the problem I encountered yet? Do you need more information? -- ___ Python tracker ___

[issue5673] Add timeout option to subprocess.Popen

2010-08-10 Thread Pablo Bitton
Pablo Bitton 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 error.txt ___

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Brian Curtin
Brian Curtin 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 feature will only

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Tim Golden
Changes by Tim Golden : -- nosy: +tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue5673] Add timeout option to subprocess.Popen

2010-08-09 Thread Pablo Bitton
Pablo Bitton 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. -- ___ Python tra

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Brian Curtin
Brian Curtin 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 __

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton
Pablo Bitton 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 &", stdin=subprocess.PIPE, stdout=su

[issue5673] Add timeout option to subprocess.Popen

2010-08-08 Thread Pablo Bitton
Changes by Pablo Bitton : -- nosy: +Pablo.Bitton ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue5673] Add timeout option to subprocess.Popen

2010-07-23 Thread Reid Kleckner
Reid Kleckner added the comment: On Thu, Jul 22, 2010 at 9:05 AM, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > The documentation should mention somewhere that timeout can be a float.  For > example, as in time.sleep docstring: > > """ >    sleep(seconds) > >    

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +gd2shoe, ragnar ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: s/Note that a result Fraction/Note that as a result, Fraction/ -- ___ Python tracker ___ ___ P

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Alexander Belopolsky
Alexander Belopolsky 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 floating point number for subsecon

[issue5673] Add timeout option to subprocess.Popen

2010-07-22 Thread Matthieu Labbé
Changes by Matthieu Labbé : -- nosy: +matthieu.labbe ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5673] Add timeout option to subprocess.Popen

2010-07-21 Thread Brian Curtin
Brian Curtin added the comment: Looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue5673] Add timeout option to subprocess.Popen

2010-07-21 Thread Reid Kleckner
Reid Kleckner 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 have to do the

[issue5673] Add timeout option to subprocess.Popen

2010-07-20 Thread Reid Kleckner
Reid Kleckner 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-20 Thread Brian Curtin
Brian Curtin 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 adding tho

[issue5673] Add timeout option to subprocess.Popen

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue5673] Add timeout option to subprocess.Popen

2010-07-17 Thread Reid Kleckner
Reid Kleckner 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 communicate docs

[issue5673] Add timeout option to subprocess.Popen

2010-07-16 Thread Brian Curtin
Brian Curtin 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-16 Thread Reid Kleckner
Reid Kleckner 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: proc = subproc

[issue5673] Add timeout option to subprocess.Popen

2010-07-14 Thread Brian Curtin
Brian Curtin 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 universal_newlines=1

[issue5673] Add timeout option to subprocess.Popen

2010-07-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +brian.curtin versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue5673] Add timeout option to subprocess.Popen

2010-07-13 Thread Reid Kleckner
Reid Kleckner 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 leave that TODO

[issue5673] Add timeout option to subprocess.Popen

2010-07-01 Thread Dave Malcolm
Dave Malcolm 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 the code: Popen.wait(

[issue5673] Add timeout option to subprocess.Popen

2010-05-29 Thread Filippo Giunchedi
Changes by Filippo Giunchedi : -- nosy: +filippo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue5673] Add timeout option to subprocess.Popen

2010-02-04 Thread Antoine Pitrou
Antoine Pitrou 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 after themselve

[issue5673] Add timeout option to subprocess.Popen

2010-02-01 Thread Reid Kleckner
Reid Kleckner 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 granularity

[issue5673] Add timeout option to subprocess.Popen

2010-01-28 Thread Antoine Pitrou
Antoine Pitrou 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 sleeping granu

[issue5673] Add timeout option to subprocess.Popen

2010-01-28 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +astrand stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue5673] Add timeout option to subprocess.Popen

2010-01-27 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue5673] Add timeout option to subprocess.Popen

2009-12-15 Thread Lev Shamardin
Changes by Lev Shamardin : -- nosy: +abbot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue5673] Add timeout option to subprocess.Popen

2009-11-17 Thread Thomas Guettler
Changes by Thomas Guettler : -- nosy: +guettli ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5673] Add timeout option to subprocess.Popen

2009-07-27 Thread Sridhar Ratnakumar
Sridhar Ratnakumar added the comment: See http://code.google.com/p/python-process/ for some ideas. -- ___ Python tracker ___ ___ Pytho

[issue5673] Add timeout option to subprocess.Popen

2009-07-27 Thread Sridhar Ratnakumar
Changes by Sridhar Ratnakumar : -- nosy: +srid ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- versions: +Python 3.2 -Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5673] Add timeout option to subprocess.Popen

2009-05-27 Thread R. David Murray
Changes by R. David Murray : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5673] Add timeout option to subprocess.Popen

2009-04-09 Thread R. David Murray
R. David Murray 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: +r.david.murray stage: -> test

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
Reid Kleckner 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 output, return Non

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
Reid Kleckner 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 problem in m

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue5673] Add timeout option to subprocess.Popen

2009-04-02 Thread Reid Kleckner
New submission from Reid Kleckner : 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 one did it: htt