summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2012-04-24 19:04:40 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2012-04-24 19:04:40 (GMT)
commit1ef9eda7bcddc494a250a6fb262c0dd3327dc443 (patch)
tree452e38c50f84bf64505d390a23984c8534a717a0 /Lib/tarfile.py
parentd11d0d6343b16f526c57ffd148a89548e0c6d681 (diff)
downloadcpython-1ef9eda7bcddc494a250a6fb262c0dd3327dc443.zip
cpython-1ef9eda7bcddc494a250a6fb262c0dd3327dc443.tar.gz
cpython-1ef9eda7bcddc494a250a6fb262c0dd3327dc443.tar.bz2
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 af32b0f..f26953e 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