[issue7195] Value error 'path is on drive c: start on drive d:' in os.path.relpath

Nick Coghlan report at bugs.python.org
Sat Oct 31 06:00:32 CET 2009


Nick Coghlan <ncoghlan at gmail.com> added the comment:

It's not the current directory that's the problem, it's the current
drive. Windows has no absolute root directory - instead, it has a root
directory for each drive. That means that "\\dir" is a path relative to
the current drive rather than an absolute path. You need to put the
drive letter in there to make it an absolute path.

That's just a fact of life when working with the windows file system,
rather than anything specific to Python or os.path.relpath.

----------
nosy: +ncoghlan
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7195>
_______________________________________


More information about the Python-bugs-list mailing list