popen[2-4] does not work with parameters inside quotes

Jimmy Retzlaff jimmy at retzlaff.com
Fri Oct 31 10:36:08 EST 2003


Anders Dalvander wrote:
> os.popen[2-4] does not work with parameters inside quotes, nor do
> os.popen. At least on Windows.
> 
> import os
> cmd = '"c:\\command.exe" "parameter inside quotes"'
> os.popen4(cmd)
> 
> Results in the following error message:
> 
> 'c:\\command.exe" "parameter inside quotes' is not recognized as an
> internal or external command,
> operable program or batch file.

Take a look at this (especially Tim Peters' very thorough explanation in
the Followups section):

http://sf.net/tracker/?func=detail&aid=512433&group_id=5470&atid=105470

Perhaps this is what you are seeing? One workaround (that isn't
beautiful) might be to create a temporary batch file with your command
line and execute that batch file.

Jimmy






More information about the Python-list mailing list