import io


def clean_lines(f):
    """
    Filter out blank lines to avoid prior cross-platform line termination problems.
    """
    lines = f.read().splitlines()
    lines = [line for line in lines if line.strip()]
    content = '\n'.join(lines)
    sio = io.StringIO()
    sio.write(content)
    sio.seek(0)
    return sio