From 089144e511ca4b388ce8b29ecf2965a8215ff238 Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Mon, 18 Oct 2010 13:49:09 +0000 Subject: Merged revisions 85689 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85689 | hirokazu.yamamoto | 2010-10-18 21:13:18 +0900 | 3 lines Issue #5117: Case normalization was needed on ntpath.relpath(). And fixed root directory issue on posixpath.relpath(). (Ported working fixes from ntpath) ........ --- Lib/ntpath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/ntpath.py') diff --git a/Lib/ntpath.py b/Lib/ntpath.py index dd7372fefa..9e4cff7a6c 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -600,7 +600,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) @@ -610,7 +610,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 -- cgit v1.2.1