'Open bzip2 compressed tar archive name for reading or writing.
Appending is not allowed.'

@classmethod
def bz2open(cls, name, mode='r', fileobj=None, compresslevel=9, **kwargs):

    if (mode not in ('r', 'w')):
        raise ValueError("mode    must    be    'r'    or    'w'.")
    try:
        import bz2
    except ImportError:
        raise CompressionError('bz2    module    is    not    available')
    if (fileobj is not None):
        fileobj = _BZ2Proxy(fileobj, mode)
    else:
        fileobj = bz2.BZ2File(name, mode, compresslevel=compresslevel)
    try:
        t = cls.taropen(name, mode, fileobj, **kwargs)
    except (IOError, EOFError):
        fileobj.close()
        if (mode == 'r'):
            raise ReadError('not    a    bzip2    file')
        raise
    except:
        fileobj.close()
        raise
    t._extfileobj = False
    return t
