Serhiy Storchaka added the comment:

> The code you *add in this patch* uses os.popen, why not use subprocess 
> instead?

Added code is just modified copy of existing code.

> Furthermore, the code catches OSError when calling popen(), but
popen() doesn't raise an exception.

It can raise an exception in rare cases. The manual of pipe mentions this. The 
code of posix_popen() contains error handling.

> FYI os.popen() now calls subprocess...

Not in 2.7.

> It's safer to use the subprocess module instead of using a shell (see the 
> recent Shellshock story) to change the environment variables and to redirect 
> stderr.

May be, but this is different issue, which is not related to this issue. If 
os.popen should be replaced with subprocess, it should be done even without 
applying the patch of this issue. Please open new issue.

However the recent Shellshock story affects only users of platforms which use 
bash or zsh as system shell (are there any?).

> subprocess now has a convinient subprocess.DEVNULL.

Not in 2.7.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17293>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to