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

Patrick Mézard pmezard at gmail.com
Fri Dec 15 15:03:17 CST 2006

Benoit Boissinot wrote:
> On 12/15/06, Patrick Mezard <pmezard at gmail.com> wrote:
>> +    # String within quotes must be the name of an executable file
>> +    if not os.path.isfile(quoted):
>> +        return False
>> +    pathext = os.environ.get('PATHEXT', '').lower().split(';')
> what is this part about ? (maybe you want to use find_in_path ?)

The last condition in cmd.exe manpage states:
- the string between the two quote characters is the name of an 
executable file.

I am not sure what they mean by that. I do not think there is anything 
like an executable bit in NTFS or even FAT, but %PATHEXT% filters 
"command" files:

The PATHEXT environment variable defines the list of file extensions 
checked by Windows NT when searching for an executable file. Like the 
PATH variable, semi-colons separate individual items in the PATHEXT 
variable. The default value of PATHEXT is .COM;.EXE;.BAT;.CMD.

Conditions I am trying to detect could be found there:

Patrick Mézard

More information about the Mercurial-devel mailing list