Windows quotes (was Re: Installer Problem Finding Modules)

Gordon McMillan gmcm at hypernet.com
Sun Apr 9 09:14:41 EDT 2000


Aahz Maruch wrote:

> In article <1257176798-9949680 at hypernet.com>,
> Gordon McMillan <gmcm at hypernet.com> wrote:
> >
> >Grrr. The fact that Windows allows spaces in directory names doesn't
> >mean the "feature" should be used.
> >
> >A better fix, I think, is to quote all the %s's.
> 
> I re-discovered recently that you need to use "-style quotes on Windows;
> '-style quotes don't work.

When I went to implement my proposed fix, I found it's even 
worse. Windows complains (when using os.system) if you 
quote an arg that *doesn't* contain a space. Using, of course, 
a suitably obtuse error message.

>>> os.system('"D:\\Programs\\Python\\python.exe" 
"d:\\programs\\python\\test.py"')
The filename, directory name, or volume label syntax is 
incorrect.

(Actually, it will accept quotes around the arg, but not around 
the program, unless there's a space in it.)


- Gordon




More information about the Python-list mailing list