This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients jaraco
Date 2009-10-23.21:39:20
SpamBayes Score 1.47506e-07
Marked as misclassified No
Message-id <>
A simple test fails:

Python 2.6.3 (r263rc1:75186, Oct 2, 2009, 20:40:30) [MSC v.1500 32 bit
(Intel)] on win32
>>> import os
>>> os.path.relpath('\\bar', 'd:\\')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\python\lib\", line 487, in relpath
    % (path_list[0], start_list[0]))
ValueError: path is on drive C:, start on drive d:

If I change the current directory to 'E:\', the error changes to "path
is on drive E:, start on drive d:".

Clearly, relpath is doing some calculations based on the current
directory, although the documentation states that it should be
performing a relative path calculation based on the supplied start
("D:\" in this case).

In Python 3.1.1, the error is "path is on mount 'C:', start on mount 'd:'"

os.path.relpath should be able to perform relative path calculations
regardless of the current directory, or the documentation should explain
why the current directory is relevant when start is supplied.
Date User Action Args
2009-10-23 21:39:23jaracosetrecipients: + jaraco
2009-10-23 21:39:23jaracosetmessageid: <>
2009-10-23 21:39:22jaracolinkissue7195 messages
2009-10-23 21:39:21jaracocreate