This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients BreamoreBoy, David.Edelsohn, aivarsk, neologix, serhiy.storchaka, vstinner
Date 2014-10-12.16:17:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413130632.19.0.217723853515.issue17293@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2014-10-12 16:17:12serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, neologix, BreamoreBoy, aivarsk, David.Edelsohn
2014-10-12 16:17:12serhiy.storchakasetmessageid: <1413130632.19.0.217723853515.issue17293@psf.upfronthosting.co.za>
2014-10-12 16:17:12serhiy.storchakalinkissue17293 messages
2014-10-12 16:17:12serhiy.storchakacreate