                      extracted = self._archive.extractfile(member)
                  except (KeyError, AttributeError):
                      # Some corrupt tar files seem to produce this
                      # (specifically bad symlinks)
                      print ("In the tar file %s the member %s is invalid: %s" %
                             (name, member.name, sys.exc_info()[1]))
                  else:
                      dirname = os.path.dirname(filename)
                      if dirname and not os.path.exists(dirname):
                          os.makedirs(dirname)
                      with open(filename, 'wb') as outfile:
 
</s> remove import sys
 </s> add  </s> remove                 except (KeyError, AttributeError):
 </s> add                 except (KeyError, AttributeError) as exc:
                    print("In the tar file %s the member %s is invalid: %s" %
                            (name, member.name, exc))
                      extracted = self._archive.extractfile(member)
                  except (KeyError, AttributeError):
                      # Some corrupt tar files seem to produce this
                      # (specifically bad symlinks)
                    print("In the tar file %s the member %s is invalid: %s" %
                            (name, member.name, exc))
                    print("In the tar file %s the member %s is invalid: %s" %
                            (name, member.name, exc))
                  else:
                      dirname = os.path.dirname(filename)
                      if dirname and not os.path.exists(dirname):
                          os.makedirs(dirname)
                      with open(filename, 'wb') as outfile:
keep keep keep keep replace replace keep keep keep keep keep
 [py3] Minor cleanup in django.utils.archive. 
django/utils/archive.py