mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-02-17 07:03:58 +00:00
Use \n when writing CSVs
This commit is contained in:
@@ -9,7 +9,7 @@ list_files = ["known_unknown_base_reverse_dns.txt", "psl_overrides.txt"]
|
||||
|
||||
|
||||
def sort_csv(filepath, column=0, strip_whitespace=True):
|
||||
with open(filepath, mode="r", newline="") as infile:
|
||||
with open(filepath, mode="r", newline="\n") as infile:
|
||||
reader = csv.reader(infile)
|
||||
header = next(reader)
|
||||
|
||||
@@ -29,7 +29,7 @@ def sort_csv(filepath, column=0, strip_whitespace=True):
|
||||
existing_values.append(row[column])
|
||||
|
||||
with open(filepath, mode="w", newline="\n") as outfile:
|
||||
writer = csv.writer(outfile)
|
||||
writer = csv.writer(outfile, lineterminator="\n")
|
||||
writer.writerow(header)
|
||||
writer.writerows(sorted_rows)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user