diff options
author | Lars Gust?bel <lars@gustaebel.de> | 2012-04-24 21:04:40 +0200 |
---|---|---|
committer | Lars Gust?bel <lars@gustaebel.de> | 2012-04-24 21:04:40 +0200 |
commit | e73a825a112482c38d664c3a956cf90e6822254f (patch) | |
tree | 6b2e13ff9b1df7a6c3b9e3443f1bdc1178cf4f26 /Lib/tarfile.py | |
parent | 1193173af8eb33b62a35bc7408e68f497d469143 (diff) | |
download | cpython-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.py | 2 |
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 |