instant team mailing list archive
-
instant team
-
Mailing list archive
-
Message #00220
Re: [HG instant] Remove file to be overwritten before shutil.copyfile to avoid exception.
It shouldn't be. That's the bug.
--
Martin
2008/9/3 Ilmar Wilbers <ilmarw@xxxxxxxxx>:
> Well, I had that problem. The problem is that the file f is the absolute
> path.
>
> ilamr
>
> Martin Sandve Alnæs wrote:
>>>
>>> changeset: 211:a571f8044546d54474867e80906689a0e6ca8aa5
>>> user: Ilmar Wilbers <ilmarw@xxxxxxxxx>
>>> date: Wed Sep 03 11:56:09 2008 +0200
>>> files: src/instant/build_module.py
>>> description:
>>> Add test:
>>> a = os.path.join(source_directory, f)
>>> b = os.path.join(module_path, f)
>>> if a == b:
>>> continue
>>> This because the files are the same, and shutil.copyfile will not
>>> overwrite, causing an error (overwriting in this case is not
>>> necessary, anyway).
>>>
>>
>> Why is this necessary? Outside the for loop is this line:
>> if source_directory != module_path:
>> how can they be the same?
>>
>>
>
References