relpath problem on windows

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Jan 31 01:30:42 EST 2009


En Fri, 30 Jan 2009 14:30:53 -0200, eliben <eliben at gmail.com> escribió:

> I'm having a problem with 2.6's new os.path.relpath function.
>
> This is correct:
>
> relpath(r'd:\abc\jho', r'd:\abc')
> => 'jho'
>
> But this isn't:
> relpath(r'd:\jho', r'd:\\')
> => '..\jho'

Looks like a real bug to me -- please submit it to http://bugs.python.org/

> Neither is this:
> relpath(r'd:\jho', r'd:')
> => '..\..\..\jho'

d: means "the current directory on drive d:", and it could be something  
like d:\a\b\c

-- 
Gabriel Genellina




More information about the Python-list mailing list