[PATCH] extensions: don't fail to load on Windows if path ends with a '\' (issue4187)

Mads Kiilerich mads at kiilerich.com
Wed Mar 5 09:10:07 CST 2014


On 03/05/2014 10:15 AM, Ed Morley wrote:
> On 05 March 2014 08:58:56, Olle wrote:
>> Nope, the patch should probably be something along the lines of:
>>
>> path = util.normpath(util.expandpath(path))
>> [...]
>> d, f = os.path.split(path.rstrip('/')__)
>
> Ah it hadn't occurred to me that using forward slashes on Windows 
> would ever work - but checking shows that .split works on any 
> separator, not just os.sep

More precisely: Python path handling libraries are quite complex and do 
also consider os.altsep - http://docs.python.org/2/library/os#os.altsep

/Mads



More information about the Mercurial-devel mailing list