[Python-checkins] cpython (3.2): Issue #12926: Fix a bug in tarfile's link extraction.
lars.gustaebel
python-checkins at python.org
Thu Jan 5 18:58:58 CET 2012
http://hg.python.org/cpython/rev/573fc99873bd
changeset: 74277:573fc99873bd
branch: 3.2
parent: 74275:a3d4cde1c357
user: Lars Gustäbel <lars at gustaebel.de>
date: Thu Jan 05 18:48:06 2012 +0100
summary:
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.
files:
Lib/tarfile.py | 6 ------
Misc/NEWS | 2 ++
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2351,12 +2351,6 @@
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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,8 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list