Skip to content

Commit

Permalink
Merge pull request #293 from lebedov/develop
Browse files Browse the repository at this point in the history
Directly extract symbolic links rather than their targets (#288).
  • Loading branch information
Carl Meyer committed Oct 23, 2011
2 parents cdec82b + 7a92423 commit be591ea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pip/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@ def untar_file(filename, location):
if member.isdir():
if not os.path.exists(path):
os.makedirs(path)
elif member.issym():
try:
tar._extract_member(member, path)
except:
e = sys.exc_info()[1]
# 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
else:
try:
fp = tar.extractfile(member)
Expand Down

0 comments on commit be591ea

Please sign in to comment.