From dee45e20f67f8d81de2d9c003ab18660036d5d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gust=C3=A4bel?= Date: Thu, 5 Jan 2012 18:48:06 +0100 Subject: 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. --- Lib/tarfile.py | 6 ------ Misc/NEWS | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 226d481..af32b0f 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2351,12 +2351,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) diff --git a/Misc/NEWS b/Misc/NEWS index 08f897f..7adf4f7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -97,6 +97,8 @@ Core and Builtins Library ------- +- Issue #12926: Fix a bug in tarfile's link extraction. + - Issue #13696: Fix the 302 Relative URL Redirection problem. - Issue #13636: Weak ciphers are now disabled by default in the ssl module -- cgit v0.12