From 3fe42d2267dba49c301ecd960f07fade18dd21ea Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Thu, 2 Jan 2025 14:49:15 -0600 Subject: [PATCH] Force utf-8 encoding when reading CSV files (part 2) --- pyinaturalist_convert/sqlite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyinaturalist_convert/sqlite.py b/pyinaturalist_convert/sqlite.py index 8b62146..ba74ff6 100644 --- a/pyinaturalist_convert/sqlite.py +++ b/pyinaturalist_convert/sqlite.py @@ -135,7 +135,7 @@ def load_table( if progress: progress.start_job(csv_path) - with sqlite3.connect(db_path) as conn, open(csv_path) as f: + with sqlite3.connect(db_path) as conn, open(csv_path, encoding='utf-8') as f: conn.execute('PRAGMA synchronous = 0') conn.execute('PRAGMA journal_mode = WAL') _create_table(conn, table_name, non_pk_cols, pk)