diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-18 12:13:18 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-18 12:13:18 (GMT) |
commit | b08820ad406b9fd291a8707e4bad41cc8486ab08 (patch) | |
tree | 4d9ef9284fb34d3e4b0e7bf7a29b60e7d952c433 /Lib/ntpath.py | |
parent | 08654e18eed3c8b0224100fe270da618d60d6eb5 (diff) | |
download | cpython-b08820ad406b9fd291a8707e4bad41cc8486ab08.zip cpython-b08820ad406b9fd291a8707e4bad41cc8486ab08.tar.gz cpython-b08820ad406b9fd291a8707e4bad41cc8486ab08.tar.bz2 |
Issue #5117: Case normalization was needed on ntpath.relpath(). And
fixed root directory issue on posixpath.relpath(). (Ported working fixes
from ntpath)
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r-- | Lib/ntpath.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index d2410f6..579673d 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -616,7 +616,7 @@ def relpath(path, start=curdir): path_abs = abspath(normpath(path)) start_drive, start_rest = splitdrive(start_abs) path_drive, path_rest = splitdrive(path_abs) - if start_drive != path_drive: + if normcase(start_drive) != normcase(path_drive): error = "path is on mount '{0}', start on mount '{1}'".format( path_drive, start_drive) raise ValueError(error) @@ -626,7 +626,7 @@ def relpath(path, start=curdir): # Work out how much of the filepath is shared by start and path. i = 0 for e1, e2 in zip(start_list, path_list): - if e1 != e2: + if normcase(e1) != normcase(e2): break i += 1 |