summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2012-04-24 21:09:17 +0200
committerLars Gustäbel <lars@gustaebel.de>2012-04-24 21:09:17 +0200
commit9f478c021dc499b0d23ee418c0dcc6b5076524aa (patch)
tree3ebaca4c7471baecc8eff3eb70b163da49fa9bbe /Lib/tarfile.py
parent1d642d2af1809cd3a37a22488755f337fb1a867a (diff)
parent1ef9eda7bcddc494a250a6fb262c0dd3327dc443 (diff)
downloadcpython-git-9f478c021dc499b0d23ee418c0dcc6b5076524aa.tar.gz
Merge with 3.2: Issue #14160: TarFile.extractfile() failed to resolve symbolic
links when the links were not located in an archive subdirectory.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index e3380a2d6b..efb277309b 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2481,7 +2481,7 @@ class TarFile(object):
"""
if tarinfo.issym():
# Always search the entire archive.
- linkname = os.path.dirname(tarinfo.name) + "/" + tarinfo.linkname
+ linkname = "/".join(filter(None, (os.path.dirname(tarinfo.name), tarinfo.linkname)))
limit = None
else:
# Search the archive before the link, because a hard link is