import difflib


def _text_compare(left_file_path, right_file_path, print_diffs):
    """
    do a text comparison of two files, ignoring CR/LF differences
    :param left_file_path: path to the 'left' file
    :param right_file_path: path to the 'right' file
    :return: True if files have the same textual contents, False if they are not
    """
    lines = {}
    for path_number, file_path in enumerate([left_file_path, right_file_path]):
        file_lines = []
        with open(file_path) as f:
            for line in f.readlines():
                line = line.strip()
                if len(line) > 0:
                    file_lines.append(line)
        lines[path_number] = file_lines
    are_equal = (lines[0] == lines[1])
    if not are_equal and print_diffs:
        print(''.join(difflib.context_diff(lines[0], lines[1], fromfile=left_file_path, tofile=right_file_path)))
    return are_equal