mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #5117: Case normalization was needed on ntpath.relpath(). And
fixed root directory issue on posixpath.relpath(). (Ported working fixes from ntpath)
This commit is contained in:
parent
08654e18ee
commit
b08820ad40
5 changed files with 27 additions and 4 deletions
|
@ -447,8 +447,8 @@ def relpath(path, start=None):
|
|||
if start is None:
|
||||
start = curdir
|
||||
|
||||
start_list = abspath(start).split(sep)
|
||||
path_list = abspath(path).split(sep)
|
||||
start_list = [x for x in abspath(start).split(sep) if x]
|
||||
path_list = [x for x in abspath(path).split(sep) if x]
|
||||
|
||||
# Work out how much of the filepath is shared by start and path.
|
||||
i = len(commonprefix([start_list, path_list]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue