relpath problem on windows

eliben eliben at gmail.com
Fri Jan 30 11:30:53 EST 2009


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'

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

What am I missing?






More information about the Python-list mailing list