def _preprocess_line(raw_line):
    """Replaces tabs with spaces and removes trailing end of line markers.

    >>> _preprocess_line('foo \\r\\n\\n')
    'foo '

    """
    return raw_line.expandtabs(4).rstrip('\r\n')
