def read_bz2(apath, encoding='utf-8', errors='ignore', process_line=None):
    """Read lines from a file in bz2 archive.

    :param process_line: a function that will be invoked to process each file's
                         line. If its result is a list, then it will be
                         returned by lines
    :type process_line: callable
    """
    from bz2 import open as bz2_open
    with bz2_open(apath, mode='rt', encoding=encoding, errors=errors) as f:
        for line in f:
            if process_line:
                line = process_line(line)
                if isinstance(line, list):
                    for line_ in line:
                        yield line_
                    continue
            yield line
