popen problem with spaces in directory-ARRGHHHH!

Steve Canfield stevecanfield at my-deja.com
Fri Jul 20 08:43:35 EDT 2001


Okay.  I'm a little frustrated.

Earlier, I wrote in message news:<603e1b49.0107191344.42808306 at posting.google.com>...
> If I open up a command prompt and type in the following:
> C:\>"e:\visual studio\ss.exe" status "$/My Project"
> I get back a bunch of text showing which files are checked out.
> 
> If I open a Python interpreter and type:
> >>> import os
> >>> os.popen(r'"e:\visual studio\ss.exe" status "$/My
> Project"').readlines()
> []
> I get an empty list.

Since I first posted this I have tried a few more things.  The FAQ
mentions bugs in popen and suggests win32pipe.popen.  I tried it and
it seems to behave exactly like os.popen.

One thing that didn't work (and I don't want to have to do this) is
using the short (8.3) version of the directory names:
>>> import os
>>> os.popen(r'e:\visual~1\ss.exe status "$/My Project"').readlines()
['$/My Project:\n', 'file1.cpp      Steve    etc...

Is this a bug in os.popen, win32pipe.popen, or (more likely) am I
missing something really obvious here?

Please help!  I really don't want to have to be restricted to short
file names.

Thanks,
steve



More information about the Python-list mailing list