[Python-Dev] Re: subprocess - updated popen5 module

Peter Astrand astrand at lysator.liu.se
Sat Oct 9 16:06:23 CEST 2004


> > subprocess.callv("somewindowsprog.exe", "some", "strange", "command", "line")
> >
> > ...if somewindowsprog.exe doesn't use the MS C runtime argument rules.
>
> I'm not sure I understand what the MSC runtime has to do with the naming
> of call/callv.

In that case, my explanation wasn't good enough :) It's somewhat
complicated. Most people will never have any problems with these issues,
but I've taken care so that the API should support all cornercases.

>Your examples don't work with call either, right?

They work with call if you use a string argument. That's the core of the
problem: The callv function doesn't support passing a string-type args
argument to the Popen constructor.


>Their
> call() equivalents:
>
> 	subprocess.call(["somewindowsprog.exe some strange command line"])
> 	subprocess.call(["somewindowsprog.exe", "some", "strange", "command", "line"])
>
> are just as broken, no?

Yes. You'll need to do:

subprocess.call("somewindowsprog.exe some strange command line")


/Peter Åstrand <astrand at lysator.liu.se>



More information about the Python-Dev mailing list