On 27/08/2011 9:15 PM, Enrico Forestieri wrote:
I am surprised by the number of ways the design of Windows can be flawed.

I don't think that ditching the shell is the way to go. Anyway, you
should use shell=False only on Windows and maybe trying to run the
command via "cmd /d /c". In this way, any converter set up through
a batch file can still be recognized (as it is now), even if there
would be the problem related to QProcess, which should be also solved,
IMO. Going further in the direction of completely banning batch files
would cripple even more the Windows port.


Ok, thanks for the explanation.


It may or may not be the way to go, but using subprocess.Popen and shell=False is the recommended way to call external tools in the python docs, so at least worth a try. It avoids security problems with shell overrun and also simplifies the escaping of arguments. Unless the docs are wrong, shell=False does not prevent batch files from running. I don't understand the connection to QProcess. Why should we use shell=False on windows and shell=True on other platforms?

--
Julien

Reply via email to