def extract_gzip (archive, compression, cmd, verbosity, interactive, outdir):
    """Extract a GZIP archive with the gzip Python module."""
    targetname = util.get_single_outfile(outdir, archive)
    try:
        with gzip.GzipFile(archive) as gzipfile:
            with open(targetname, 'wb') as targetfile:
                data = gzipfile.read(READ_SIZE_BYTES)
                while data:
                    targetfile.write(data)
                    data = gzipfile.read(READ_SIZE_BYTES)
    except Exception as err:
        msg = "error extracting %s to %s: %s" % (archive, targetname, err)
        raise util.PatoolError(msg)
    return None
def extract_gzip ( archive , compression , cmd , verbosity , interactive , outdir ) : targetname = util . get_single_outfile ( outdir , archive ) try : with gzip . GzipFile ( archive ) as gzipfile : with open ( targetname , 'wb' ) as targetfile : data = gzipfile . read ( READ_SIZE_BYTES ) while data : targetfile . write ( data ) data = gzipfile . read ( READ_SIZE_BYTES ) except Exception as err : msg = "error extracting %s to %s: %s" % ( archive , targetname , err ) raise util . PatoolError ( msg ) return None
Extract a GZIP archive with the gzip Python module.