Mark Mc Mahon wrote:
> On 11/16/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote:
> <SNIP>
>
> > Probably the issue here is that I need to be using some Windows API to
> > invoke Python instead of execv/spawnv, in order to prevent the command
> > line from being re-parsed.  :(
> > Failing that, using the short name API might be the best workaround,
> > although technically I believe a short name can have a space in it too!
> >  It's just not as likely to.
> >
> I think it cannot contain a space - DOS didn't allow spaces in names
> (dear old DOS :-)
>
> For example I created a file "t t.txt" with notepad and then did a dir /x
> ....
> 16/11/2005  16:40 PM                 6 TTBC95~1.TXT t t.txt
> ....
>
> And you can see that the filename doesn't contain a space.

I tried using " again; it turns out I was testing the wrong version of
the code, which explains why it so stubbornly refused to work.  :)  As
it happens, both Python and the script name need to be quoted to avoid
this issue.

The only things I worry about now are:

1. If you have a quote mark in a directory name, you're probably
screwed.  :)
2. What happens to unquoted stuff later on the command line?

But the quoting fixes are sufficient for now, so I'm going to just go
with the double-quote solution rather than possibly introducing new
issues with short names.

Reply via email to