bug in os.system?

mensanator at aol.com mensanator at aol.com
Tue Oct 18 22:09:14 EDT 2005


nicksjacobson at yahoo.com wrote:
> OK, I give up.  Why does workaround #2 work?

Well, there was a time when the cmd prompt treated all
spaces as delimiters, so

    >cd My Documents

would fail. Nowadays you can do that successfully and even

    >cd My Documents\My Pictures

works.

In the old days, if a directory had a space, you had to
enclose it in quotes

    >cd "My Documents"

But you didn't actually need to include the trailing quote,
so you could get away with

    >cd "My Documents

I'm sure if you looked it up, Microsoft would say

    This behaviour is by design.


>
> Also, I didn't realize this before, but when you call os.spawnv, the
> argument list you pass starts with the name of the executable you're
> calling!  When you call a program from cmd.exe, that program name is
> the first parameter automatically.  But with spawnv, you do that
> manually!
> 
> Anyway, thanks for your help!




More information about the Python-list mailing list