From 0c9d6e326aeed5dba66f3efc5ff8f2da9b96b432 Mon Sep 17 00:00:00 2001 From: jxy Date: Mon, 26 May 2025 03:51:58 +0800 Subject: [PATCH] fix: possible DecodeError --- src/backend/scripts/run_all_ddls.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/scripts/run_all_ddls.py b/src/backend/scripts/run_all_ddls.py index 4b22b78..ccb1930 100644 --- a/src/backend/scripts/run_all_ddls.py +++ b/src/backend/scripts/run_all_ddls.py @@ -55,7 +55,7 @@ def execute_sql_scripts_in_order(engine, directory, split_statements=True): for sql_file in sql_files: logger.info(f"Running script: {sql_file.name}") # Read the SQL file - with open(sql_file, "r") as file: + with open(sql_file, "r", encoding='utf-8') as file: sql_script = file.read() # Execute the SQL script @@ -72,13 +72,13 @@ def main( """ if refresh: logger.info(f"Running drop_all.sql script...") - with open(drop_all_script, "r") as file: + with open(drop_all_script, "r", encoding='utf-8') as file: drop_script = file.read() execute_sql_script(engine, drop_script) if refresh_data: logger.info(f"Running drop_all_data.sql script...") - with open(drop_all_data_script, "r") as file: + with open(drop_all_data_script, "r", encoding='utf-8') as file: drop_data_script = file.read() execute_sql_script(engine, drop_data_script)