Fix posixpath.realpath() for multiple pardirs (fixes issue #6975).

This commit is contained in:
Serhiy Storchaka 2013-02-18 12:22:05 +02:00
commit 2a47954895
2 changed files with 22 additions and 2 deletions

View file

@ -390,9 +390,11 @@ def _joinrealpath(path, rest, seen):
if name == pardir:
# parent dir
if path:
path = dirname(path)
path, name = split(path)
if name == pardir:
path = join(path, pardir, pardir)
else:
path = name
path = pardir
continue
newpath = join(path, name)
if not islink(newpath):