Leaving this here because I spent an hour on it. My Python CSV export had blank lines between every record when opened on Windows. Opening the output with newline="" fixed it: with open("out.csv", "w", newline="") as f: writer = csv.writer(f) I had been trying to strip the strings before writing them.