[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-07-05 Thread STINNER Victor
STINNER Victor added the comment: See also issue #12494: "subprocess: check_output() doesn't close pipes on error". -- nosy: +haypo ___ Python tracker ___ _

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 361f87c8f36a by Łukasz Langa in branch 'default': Cleaned up a backward merge after fixes issue #12044. http://hg.python.org/cpython/rev/361f87c8f36a -- ___ Python tracker

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: did my commits in the reverse order (default before 3.2), oops. this is fixed. this wasn't ever in 2.7 so no need for the documentation note. i'm not worried about adding a note about 3.2.0 vs 3.2.1 beyond the mention in Misc/NEWS as this was new in 3.2.

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset b00a64a5cb93 by Gregory P. Smith in branch '3.2': merge - 7a3f3ad83676 Fixes Issue #12044. http://hg.python.org/cpython/rev/b00a64a5cb93 -- ___ Python tracker __

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7a3f3ad83676 by Gregory P. Smith in branch 'default': - Issue #12044: Fixed subprocess.Popen when used as a context manager to http://hg.python.org/cpython/rev/7a3f3ad83676 -- nosy: +python-dev ___ Pytho

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- assignee: -> gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Charles-François Natali
Charles-François Natali added the comment: I'm re-opening this issue, since Gregory agrees to change the current behaviour. Patch attached (along with test and documentation update). -- components: +Library (Lib) keywords: +patch resolution: rejected -> status: closed -> open Added fil

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-11 Thread Gregory P. Smith
Gregory P. Smith added the comment: I didn't initially like the idea of __exit__ blocking on another process... but the zombie issue is real does make me think we should reconsider this and have it wait(). It is a backwards incompatible change if anyone has started using the Popen context manag

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-10 Thread Charles-François Natali
Charles-François Natali added the comment: There's just one thing I'm concerned with. People using context managers tend to expect the __exit__ method to perform cleanup actions and release corresponding resources if necessary, for example closing the underlying file or socket. So my guess is th

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, no, looks ok for me then :) -- resolution: -> rejected status: pending -> closed ___ Python tracker ___

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Brian Curtin
Brian Curtin added the comment: Looks like we already mention that. """ Popen objects are supported as context managers via the with statement, closing any open file descriptors on exit. """ Antoine, do you think this should be more strongly worded? -- status: open -> pending __

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I'm thinking there's not a lot we can do here, but also not a lot that > we should do here. We don't want to wait, and we don't want to close, > so maybe we should just document that the usage should be limited only > to expecting the open handles to be closed

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Brian Curtin
Brian Curtin added the comment: Hm, yeah, not sure what I was thinking there. I'm thinking there's not a lot we can do here, but also not a lot that we should do here. We don't want to wait, and we don't want to close, so maybe we should just document that the usage should be limited only to

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Actually, I don't think the wait() is a good idea. If you want to > block and infinitely wait on the process to close, you should do so > explicitly. Ok. > It's probably better that we try to use terminate() or kill() and raise if > that fails. Uh, I think

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Brian Curtin
Brian Curtin added the comment: Actually, I don't think the wait() is a good idea. If you want to block and infinitely wait on the process to close, you should do so explicitly. It's probably better that we try to use terminate() or kill() and raise if that fails. -- ___

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Seems like it would be enough to add a wait() at the end? Probably, perhaps with a try/finally? I'm not entirely sure this is a good idea, by the way. May there be some drawbacks? -- ___ Python tracker

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Brian Curtin
Brian Curtin added the comment: Seems like it would be enough to add a wait() at the end? diff -r 9e473917cbfb Lib/subprocess.py --- a/Lib/subprocess.py Mon May 09 21:17:02 2011 +0200 +++ b/Lib/subprocess.py Mon May 09 15:30:02 2011 -0500 @@ -796,6 +796,7 @@ self.stderr.close()

[issue12044] subprocess.Popen.__exit__ doesn't wait for process end

2011-05-09 Thread Antoine Pitrou
New submission from Antoine Pitrou : I find it a bit strange that Popen.__exit__ closes all standard file descriptors leading to the child process, but doesn't wait for process end afterwards. (context management support was added in issue10554) -- messages: 135635 nosy: brian.curtin,