summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2012-01-05 17:53:00 (GMT)
committerLars Gustäbel <lars@gustaebel.de>2012-01-05 17:53:00 (GMT)
commit8f771a47168053aebe7ef115b6a4a319cec041f2 (patch)
treef2a8e87e11effbf3fc0d8d9a5c8143cd2de04530 /Lib/tarfile.py
parentfa26c4251ed5abeb829738b6b7c1cdefa463a6f5 (diff)
parentdee45e20f67f8d81de2d9c003ab18660036d5d73 (diff)
downloadcpython-8f771a47168053aebe7ef115b6a4a319cec041f2.zip
cpython-8f771a47168053aebe7ef115b6a4a319cec041f2.tar.gz
cpython-8f771a47168053aebe7ef115b6a4a319cec041f2.tar.bz2
Merge from 3.2: Issue #12926: Fix a bug in tarfile's link extraction.
On platforms that do not support (symbolic) links, tarfile offers a work-around and extracts a link in an archive as the regular file the link is pointing to. On other platforms, this code was accidentally executed even after the link had been successfully extracted which failed due to the already existing link.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 427f132..5c9d3a8 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2340,12 +2340,6 @@ class TarFile(object):
self._extract_member(self._find_link_target(tarinfo),
targetpath)
except symlink_exception:
- if tarinfo.issym():
- linkpath = os.path.join(os.path.dirname(tarinfo.name),
- tarinfo.linkname)
- else:
- linkpath = tarinfo.linkname
- else:
try:
self._extract_member(self._find_link_target(tarinfo),
targetpath)