提交 abf4576c 编写于 作者: I Ian Bicking

[svn r21268] make certain untar errors into warnings

上级 3f95273a
......@@ -16,6 +16,8 @@ svn trunk
* Download links that include embedded spaces or other unsafe
characters (those characters get %-encoded).
* Turn some tar file errors into warnings.
0.2
---
......
......@@ -1835,7 +1835,15 @@ class RequirementSet(object):
if not os.path.exists(path):
os.makedirs(path)
else:
fp = tar.extractfile(member)
try:
fp = tar.extractfile(member)
except KeyError, e:
# Some corrupt tar files seem to produce this
# (specifically bad symlinks)
logger.warn(
'In the tar file %s the member %s is invalid: %s'
% (filename, member.name, e))
continue
if not os.path.exists(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))
destfp = open(path, 'wb')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册