with open(path_1, 'r') as f1:
    with open(path_2, 'r') as f2:
        while l1 != '' and l2 != '':
            l1 = f1.readline()
l2 = f2.readline()
if l1 != l2:
    return False
return True
Python : compare two files with different line endings