From ee7a7dc98668163b8e96db50da81ddb7cb2f4c9b Mon Sep 17 00:00:00 2001 From: Dicklesworthstone Date: Tue, 21 May 2024 14:04:53 -0400 Subject: [PATCH] Fix --- service_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_functions.py b/service_functions.py index a7a7713..7999b01 100644 --- a/service_functions.py +++ b/service_functions.py @@ -508,7 +508,7 @@ async def read_and_rewrite_file_with_safe_encoding(temp_file_path: str): traceback.print_exc() raise HTTPException(status_code=400, detail=f"Error while reading and decoding file: {e}") try: - with open(temp_file_path, 'w', encoding='utf-8') as buffer: + with open(temp_file_path, 'wb') as buffer: buffer.write(content) except Exception as e: logger.error(f"Error while writing file with utf-8 encoding: {e}")