relpath problem on windows
Scott David Daniels
Scott.Daniels at Acm.Org
Fri Jan 30 16:36:28 EST 2009
eliben wrote:
> I'm having a problem with 2.6's new os.path.relpath function.
> ... But this isn't [correct]:
> relpath(r'd:\jho', r'd:\\')
> => '..\jho'
> Neither is this:
> relpath(r'd:\jho', r'd:')
> => '..\..\..\jho'
>
> What am I missing?
There is no way to write a raw string for text ending in a single
backslash. r'd:\\' == 'd:\\\\'
What you want is relpath(r'd:\jho', 'd:\\')
But it turns out this doesn't work, either.
File a bug.
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Python-list
mailing list