(self, tarinfo, targetpath)
Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
Make a ( symbolic ) link called targetpath . If it cannot be created ( platform limitation ) we try to make a copy of the referenced file instead of a link .
def makelink(self, tarinfo, targetpath):
        """Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        """
        try:
            # For systems that support symbolic and hard links.
            if tarinfo.issym():
                os.symlink(tarinfo.linkname, targetpath)
            else:
                # See extract().
                if os.path.exists(tarinfo._link_target):
                    os.link(tarinfo._link_target, targetpath)
                else:
                    self._extract_member(self._find_link_target(tarinfo),
                                         targetpath)
        except symlink_exception:
            try:
                self._extract_member(self._find_link_target(tarinfo),
                                     targetpath)
            except KeyError:
                raise ExtractError("unable to resolve link inside archive")
def makelink ( self , tarinfo , targetpath ) : try : # For systems that support symbolic and hard links. if tarinfo . issym ( ) : os . symlink ( tarinfo . linkname , targetpath ) else : # See extract(). if os . path . exists ( tarinfo . _link_target ) : os . link ( tarinfo . _link_target , targetpath ) else : self . _extract_member ( self . _find_link_target ( tarinfo ) , targetpath ) except symlink_exception : try : self . _extract_member ( self . _find_link_target ( tarinfo ) , targetpath ) except KeyError : raise ExtractError ( "unable to resolve link inside archive" )