[Tutor] subprocess.call list vs. str argument

Dave Angel davea at davea.name
Tue Feb 25 22:54:42 CET 2014


 eryksun <eryksun at gmail.com> Wrote in message:
>
> 
> FYI, in Windows the situation is different. CreateProcess takes a
> string argument, so the setup code changes to the following:
> 

> 
> It's fine to use a string for args in Windows, and you may need to if
> the program parses the command line differently than list2cmdline,
> which escapes the arguments according to the rules used by Microsoft's
> CRT.

CreateProcess has its own design bobbles as well. For example,  if
 you forget to put quotes around the program name,  it will
 happily try to add ".exe" to *multiple* places in the hopes that
 one of them will work.

Adding a file c:\program.exe to a system will blow up lots of
 programs that were working by mistake for years.


-- 
DaveA



More information about the Tutor mailing list