shlex, unicode, and subprocess.Popen on Windows

Tim Golden mail at timgolden.me.uk
Mon Aug 30 13:45:29 EDT 2010


On 30/08/2010 3:24 PM, python at bdurham.com wrote:
> My understanding is that the only time one needs to use shell=True is
> when they are 'executing' a non-executable file whose executable must be
> discovered via file association rules? Does that sound accurate?

I'm not entirely sure what you mean by that last piece. Certainly, shell
must be used if you're trying to run, eg, dir or copy which aren't executables
in their own right but are sub-executables [a word I've just invented] of
the command processor (cmd.exe). There's a slightly open question as to
whether you need to say shell=True when running batch files (.bat/.cmd).
My experience is not; others say yes.

The ".... must be discovered via file association rules" looks out
of place in your explanation above. (read: I can't see what you're
getting at :) )

TJG



More information about the Python-list mailing list