mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
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.
This commit is contained in:
parent
cdf6cd9ff3
commit
dee45e20f6
2 changed files with 2 additions and 6 deletions
|
|
@ -2351,12 +2351,6 @@ def makelink(self, tarinfo, targetpath):
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue