[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Use subprocess.Popen for executing commands in cmdline tests

From: jeremy hinds <jeremy.hinds_at_gmail.com>
Date: Mon, 7 Apr 2008 08:10:19 -0600

On Mon, Apr 7, 2008 at 3:35 AM, Branko Èibej <brane_at_xbc.nu> wrote:
> jeremy hinds wrote:
>
> > [[[
> > In cmdline tests, use subprocess.Popen for executing commands to allow
> > support for exit-code checks on both Windows and posix systems. This
> makes
> > the test suite require Python version >= 2.4.
> >
> >
>
> I do have a couple questions.
>
> * Why run Popen with shell=True? I don't think we need that and can
> avoid all kinds of quoting magic that we do now, since Popen does
> the system-specific argument quoting for us.

I could have sworn that I saw at least one instance of a pipeline
being executed through this, but I'm not having any luck finding it
now. I might have been imagining things. I'll take a closer look and
see if there's any reason not to pass the command & args to Popen as a
list.

> * I /think/ i recall that we have the binary-mode parameter for a
> reason. I don't remember the reason offhand, but just killing off
> that option doesn't seem safe. (FWIW, the reason is most likely
> related to text and binary being different on Windows.)

I think you're right, in that the binary-mode param was only used when
invoking os.popen3() on platforms without the Popen3 class (Windows).
But having replaced both of those with subprocess.Popen, there's
nowhere to use that parameter anymore. At least, I don't see anything
that looks analogous in creationflags or anywhere like that.

>
> -- Brane
>
>
Received on 2008-04-07 16:10:40 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.