summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-18 10:22:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-18 10:22:05 (GMT)
commit2a47954895b8a8cb0f63e4dbf957cd3f48e84d16 (patch)
tree0035bdd0229324286b353a3f479f02471d12fdf9 /Lib/posixpath.py
parent580e2c1a65334cf702290e9a789670828e4673ee (diff)
parent407aa2df2aa81180df611148fbfe7a7f57673a74 (diff)
downloadcpython-2a47954895b8a8cb0f63e4dbf957cd3f48e84d16.zip
cpython-2a47954895b8a8cb0f63e4dbf957cd3f48e84d16.tar.gz
cpython-2a47954895b8a8cb0f63e4dbf957cd3f48e84d16.tar.bz2
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 6390a865..e1d59b6 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -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):