'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):

    directories = []
    if (members is None):
        members = self
    for tarinfo in members:
        if tarinfo.isdir():
            directories.append(tarinfo)
            tarinfo = copy.copy(tarinfo)
            tarinfo.mode = 448
        self.extract(tarinfo, path, set_attrs=(not tarinfo.isdir()))
    directories.sort(key=(lambda a: a.name))
    directories.reverse()
    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 as e:
            if (self.errorlevel > 1):
                raise
            else:
                self._dbg(1, ('tarfile:    %s' % e))
