[PATCH] Fix win32 command processor quoting in system() calls

Patrick Mézard pmezard at gmail.com
Fri Dec 15 16:23:28 CST 2006


Alexis S. L. Carvalho wrote:
> I've attached a patch to that issue, but it hasn't attracted any
> testers.  Could you give it a try?
> 
> http://www.selenic.com/mercurial/bts/file226/system.patch
> 
> That patch always adds an additional pair of quotes to the command line,
> without trying to figure out if cmd.exe will remove them or not.  I
> /think/ it should work, but it really needs some real testing...

It solves the case which made me write my own overcomplicated patch at 
first. Besides, spending twenty minutes beating os.system() with all 
combinations of quoted executable/quoted arguments, I cannot find any 
your patch does not handle. I suppose there may be one involving 
escaping and special characters and spaces and other stuff, but really 
who cares.

+1 for it.

Tell me if you have tests you would like to run, I would be happy to do it.
--
Patrick Mézard


More information about the Mercurial-devel mailing list