Brian Curtin cur...@acm.org added the comment:
Here's a patch which implements the context manager and adds a few tests and a
small doc change.
Tested on Mac and Windows.
--
keywords: +patch
nosy: +brian.curtin
Added file: http://bugs.python.org/file19916/subprocess.diff
Éric Araujo mer...@netwok.org added the comment:
Thanks! Patch looks good, tests pass and doc builds.
I have one question and two micro-nitpicks on
http://codereview.appspot.com/3441041/
--
___
Python tracker rep...@bugs.python.org
Brian Curtin cur...@acm.org added the comment:
I updated the doc to be much more simple. I got used to sys.executable based
tests :) New patch attached.
As for __del__, I think it should do it's thing, and the exit will do it's own.
Context managers are traditionally used on file-based
Éric Araujo mer...@netwok.org added the comment:
New doc looks good. Suggested changes: make with a link, explaing why it’s a
context manager.
- Popen objects are supported as context managers via the ``with`` statement.
+ Popen objects are supported as context managers via the
Éric Araujo mer...@netwok.org added the comment:
:keyword:`with`` → :keyword:`with`
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10554
___
___
New submission from Éric Araujo mer...@netwok.org:
I propose that __enter__ and __exit__ be added to subprocess.Popen. __enter__
returns self, __exit__ closes open file descriptors.
__exit__ could also do the same checks that __del__ does (and which I don’t
entirely understand.
See also