[Distutils] install w/o build, spaces in directory names

Thomas Heller thomas.heller@ion-tof.com
Fri, 11 Feb 2000 14:43:46 +0100


[explanation why quoting arguments breaks distutils on unix]
>
> 'self.spawn()' in both cases is a convenience method provided by the
> base class, CCompiler; it's just a wrapper around
> 'distutils.spawn.spawn()', which in turn is a wrapper around either
> '_spawn_posix()' or '_spawn_nt()'.  Both of these have one required
> argument, which is a *list of command-line arguments*.  '_spawn_posix()'
> forks and, in the child, 'exec()'s that list of command-line arguments.
> Key point: no shell is ever involved, so no quoting need be done;
> indeed, no quoting *can* be done, as the command-line must be split up
> into a (Python) list of arguments before you can do anything with it.

Neither is a shell involved on NT, so the shell quoting rules do not matter.

From a little investigation, it seems that MSVC can use
-I"c:\Program files" as well as "-Ic:\Program Files",
and this makes the whole business somewhat easier:
We do not need to quote the directory, we can quote the whole parameter
if it contains spaces. See my other post which contains a patch
to spawn.py. Don't know however what happens if the argument already
contains
quotes...

Thomas Heller