summaryrefslogtreecommitdiff
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-18 12:21:30 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-18 12:21:30 +0200
commit407aa2df2aa81180df611148fbfe7a7f57673a74 (patch)
tree06e1395d9534ba27344ed479a32794a05f76cfe9 /Lib/posixpath.py
parentf844f7e361bd23358d511bb74c71b01c5207e191 (diff)
parent467393dff5666b87eafe46660abf6ea0e2018c64 (diff)
downloadcpython-git-407aa2df2aa81180df611148fbfe7a7f57673a74.tar.gz
Fix posixpath.realpath() for multiple pardirs (fixes issue #6975).
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index d089809d99..b1e1a9255e 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -418,9 +418,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):