@classmethod<EOL><INDENT>def gzopen(cls, name, mode="<STR_LIT:r>", fileobj=None, compresslevel=<NUM_LIT:9>, **kwargs):<DEDENT>
if len(mode) > <NUM_LIT:1> or mode not in "<STR_LIT>":<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>import gzip<EOL>gzip.GzipFile<EOL><DEDENT>except (ImportError, AttributeError):<EOL><INDENT>raise CompressionError("<STR_LIT>")<EOL><DEDENT>extfileobj = fileobj is not None<EOL>try:<EOL><INDENT>fileobj = gzip.GzipFile(name, mode + "<STR_LIT:b>", compresslevel, fileobj)<EOL>t = cls.taropen(name, mode, fileobj, **kwargs)<EOL><DEDENT>except IOError:<EOL><INDENT>if not extfileobj and fileobj is not None:<EOL><INDENT>fileobj.close()<EOL><DEDENT>if fileobj is None:<EOL><INDENT>raise<EOL><DEDENT>raise ReadError("<STR_LIT>")<EOL><DEDENT>except:<EOL><INDENT>if not extfileobj and fileobj is not None:<EOL><INDENT>fileobj.close()<EOL><DEDENT>raise<EOL><DEDENT>t._extfileobj = extfileobj<EOL>return t<EOL>
Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.