Message94394
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\ntpath.py", 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:23 | jaraco | set | recipients:
+ jaraco |
2009-10-23 21:39:23 | jaraco | set | messageid: <1256333963.61.0.85026079779.issue7195@psf.upfronthosting.co.za> |
2009-10-23 21:39:22 | jaraco | link | issue7195 messages |
2009-10-23 21:39:21 | jaraco | create | |
|