(self, path=".", members=None)
Extract all members from the archive to the current working
       directory and set owner, modification time and permissions on
       directories afterwards. `path' specifies a different directory
       to extract to. `members' is optional and must be a subset of the
       list returned by getmembers().
Extract all members from the archive to the current working
       directory and set owner, modification time and permissions on
       directories afterwards. `path' specifies a different directory
       to extract to. `members' is optional and must be a subset of the
       list returned by getmembers().
Extract all members from the archive to the current working directory and set owner modification time and permissions on directories afterwards . path specifies a different directory to extract to . members is optional and must be a subset of the list returned by getmembers () .
def _extractall(self, path=".", members=None):
    """Extract all members from the archive to the current working
       directory and set owner, modification time and permissions on
       directories afterwards. `path' specifies a different directory
       to extract to. `members' is optional and must be a subset of the
       list returned by getmembers().
    """
    import copy
    import operator
    from tarfile import ExtractError
    directories = []

    if members is None:
        members = self

    for tarinfo in members:
        if tarinfo.isdir():
            # Extract directories with a safe mode.
            directories.append(tarinfo)
            tarinfo = copy.copy(tarinfo)
            tarinfo.mode = 448 # decimal for oct 0700
        self.extract(tarinfo, path)

    # Reverse sort directories.
    if sys.version_info < (2, 4):
        def sorter(dir1, dir2):
            return cmp(dir1.name, dir2.name)
        directories.sort(sorter)
        directories.reverse()
    else:
        directories.sort(key=operator.attrgetter('name'), reverse=True)

    # Set correct owner, mtime and filemode on directories.
    for tarinfo in directories:
        dirpath = os.path.join(path, tarinfo.name)
        try:
            self.chown(tarinfo, dirpath)
            self.utime(tarinfo, dirpath)
            self.chmod(tarinfo, dirpath)
        except ExtractError:
            e = sys.exc_info()[1]
            if self.errorlevel > 1:
                raise
            else:
                self._dbg(1, "tarfile: %s" % e)
def _extractall ( self , path = "." , members = None ) : import copy import operator from tarfile import ExtractError directories = [ ] if members is None : members = self for tarinfo in members : if tarinfo . isdir ( ) : # Extract directories with a safe mode. directories . append ( tarinfo ) tarinfo = copy . copy ( tarinfo ) tarinfo . mode = 448 # decimal for oct 0700 self . extract ( tarinfo , path ) # Reverse sort directories. if sys . version_info < ( 2 , 4 ) : def sorter ( dir1 , dir2 ) : return cmp ( dir1 . name , dir2 . name ) directories . sort ( sorter ) directories . reverse ( ) else : directories . sort ( key = operator . attrgetter ( 'name' ) , reverse = True ) # Set correct owner, mtime and filemode on directories. for tarinfo in directories : dirpath = os . path . join ( path , tarinfo . name ) try : self . chown ( tarinfo , dirpath ) self . utime ( tarinfo , dirpath ) self . chmod ( tarinfo , dirpath ) except ExtractError : e = sys . exc_info ( ) [ 1 ] if self . errorlevel > 1 : raise else : self . _dbg ( 1 , "tarfile: %s" % e )