summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gust?bel <lars@gustaebel.de>2012-04-24 21:04:40 +0200
committerLars Gust?bel <lars@gustaebel.de>2012-04-24 21:04:40 +0200
commite73a825a112482c38d664c3a956cf90e6822254f (patch)
tree6b2e13ff9b1df7a6c3b9e3443f1bdc1178cf4f26 /Lib/tarfile.py
parent1193173af8eb33b62a35bc7408e68f497d469143 (diff)
downloadcpython-e73a825a112482c38d664c3a956cf90e6822254f.tar.gz
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 af32b0f2cb..f26953e2bb 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2496,7 +2496,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