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

From: Jimmy Retzlaff (jimmy_at_retzlaff.com)
Date: 10/31/03


Date: Fri, 31 Oct 2003 07:36:08 -0800
To: <python-list@python.org>

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



Relevant Pages

  • xcopy is not recognized as an internal or external command
    ... operable program or batch file. ... 'C:\xcopy' is not recognized as an internal or external command, ... Munging English.cfg ...
    (microsoft.public.windowsxp.general)
  • RE: Error in Event Viewer - Active in HAT
    ... unfortunately I get this error when I start the trace. ... 'tracelog.exe' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.biztalk.general)
  • basic problems with ocamlopt compiler
    ... doesn't work on ocamlopt. ... Here's the error message I get: ... 'ml' is not recognized as an internal or external command, ... program or batch file. ...
    (comp.lang.ml)
  • Re: All DHCP Servers Info HELP!
    ... Recieved bunch of errors. ... ''' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Clock on pc time loss
    ... Time loss with a fresh battery will be very small (a few milliseconds ... Ken Blake - Microsoft MVP Windows: ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ...
    (microsoft.public.windowsxp.help_and_support)