[ditrack commit] r1627 - in src/trunk/DITrack: . Util
Vlad Skvortsov
vss at 73rus.com
Mon Jun 4 15:37:44 PDT 2007
Ivan Glushkov wrote:
[skipped]
>>> +
>>> +import os
>>> +
>>> +def spawnvp(mode, file, args):
>>> + """ Make the same as os.spawnvp(), available at all platforms."""
>>> +
>>> + if os.name == "posix":
>>> + os.spawnvp(mode, file, args)
>>> + elif os.name == "nt":
>>> + if file == os.path.abspath(file):
>>>
>>
>> Why don't we accept a relative file name? I think we should just check
>> the file existence.
>
> We do accept a relative file name! For the windows, we don't have
> spawnvp, so we should find absolute paths by ourselves.
> So if the path is absolute we just call spawnv, and if it's relative
> we should find absolute one.
> i don't check for the file existence, i reassign this to the spawnvp.
The logic looks flawed here: if the name passed is a relative one (e.g.
"./test.py" or "../test.py", etc) we should not be looking it up in $PATH.
--
Vlad Skvortsov, vss at 73rus.com, http://vss.73rus.com
More information about the Dev
mailing list