From 1defd4259f6be256a9434342a01c96e44ef5215c Mon Sep 17 00:00:00 2001 From: Thomas Hilscher Date: Tue, 4 Apr 2023 00:15:53 +0200 Subject: [PATCH] Windows pain --- wgmaster/csv.py | 2 +- wgmaster/import.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wgmaster/csv.py b/wgmaster/csv.py index edeabf5..d079fd9 100644 --- a/wgmaster/csv.py +++ b/wgmaster/csv.py @@ -28,7 +28,7 @@ def parse(filename: str) -> Iterator[Dict[str, Any]]: if w is not None: yield w.strip() - with open(filename, 'r') as f: + with open(filename, 'r', encoding='utf-8') as f: header: Optional[Tuple[str]] = None for line in f: if header is None: diff --git a/wgmaster/import.py b/wgmaster/import.py index 83eb506..017c39a 100755 --- a/wgmaster/import.py +++ b/wgmaster/import.py @@ -82,7 +82,7 @@ if __name__ == '__main__': if not args.keep: for file_name in get_sql_files(): - with open(file_name) as sql_file: + with open(file_name, encoding='utf-8') as sql_file: print(f'Executing {file_name}') DB_CNX.executescript(sql_file.read())