[Python-Dev] test_popen broken on Win2K

Thomas Heller theller@python.net
07 Mar 2003 22:48:29 +0100


Tim Peters <tim.one@comcast.net> writes:

> Someone changed test_popen to "quote" the path to python:
> 
>     cmd = '"%s" -c "import sys;print sys.argv" %s' % (sys.executable,
> cmdline)
>            ^  ^
> 
> The double-quote characters above the carets are new.
> 
> This causes test_popen to fail on Win2K, but not on Win98.  The relevant
> difference appears to be the default shell (cmd.exe on the former,
> command.com on the latter).

In distutils we had a similar problem. I don't remember the details
at the moment exactly, but I think enclosing sys.executable in double
quotes *only* when it contains spaces should do the trick.

Thomas