explicitly define encoding for windows

This commit is contained in:
Yannik Schmidt
2021-05-09 14:44:43 +02:00
parent bf3a7b1bae
commit 29ba9f6d15

View File

@@ -91,7 +91,7 @@ def checkLastMonths(backwardsMonths=6):
# parse and dump
csvOut = os.path.join(CSV_DIR, 'Wetterdaten-{}-{}.csv'.format(
calendar.month_name[monthNumber], year))
with open(csvOut, 'w', newline='') as file:
with open(csvOut, 'w', newline='', encoding="utf-8") as file:
fieldnames = list(headerMappings.values())
writer = csv.DictWriter(file, fieldnames=fieldnames, delimiter=";")