[python-win32] Bug with system()/popen() ?

Bob Gailer bgailer at alum.rpi.edu
Fri May 13 18:25:43 CEST 2005


At 02:08 AM 5/13/2005, Ludvig Strigeus wrote:
>I'm trying to use system to run the following command:
>
>cmd  = C:\Program Files\Tortoise SVN\bin\TortoiseProc.exe
>Argv[1] = /command:update
>Argv[2] = /path:"C:\Temp\Test"
>Argv[3] = /notempfile
>Argv[4] = /closeonend
>
>But all my attempts to convert this to a linearalized command line
>fails...
>
>This is my most successful try (don't ask me why i have "" at the start,
>it doesn't work at all otherwise):
>os.system('""C:\Program Files\Tortoise SVN\bin\TortoiseProc.exe"
>/command:update /path:"C:\Temp\Test" /notempfile /closeonend')

At the interactive prompt type:
 >>> '""C:\Program Files\Tortoise SVN\bin\TortoiseProc.exe"/command:update 
/path:"C:\Temp\Test" /notempfile /closeonend
And what you get is:
'""C:\\Program Files\\Tortoise SVN\x08in\\TortoiseProc.exe"/command:update 
/path:"C:\\Temp\\Test" /notempfile /closeonend'

Notice something odd? What happened to the \b?
 From the Refernce Manual: "Unless an "r" or "R" prefix is present, escape 
sequences in strings are interpreted according to rules similar to those 
used by Standard C." \b is the escape sequence for backspace.

That might help!

>[snip]

Bob Gailer
mailto:bgailer at alum.rpi.edu
510 558 3275 home
720 938 2625 cell  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050513/f4a31cd2/attachment.html


More information about the Python-win32 mailing list