From 83c97847c89a1c4336f8c824a6b34aa54de17f33 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 09:47:14 +0000 Subject: [PATCH] feat: Updated gpt_engineer/core/chat_to_files.py --- gpt_engineer/core/chat_to_files.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpt_engineer/core/chat_to_files.py b/gpt_engineer/core/chat_to_files.py index 2decb9030c..e43e324ff7 100644 --- a/gpt_engineer/core/chat_to_files.py +++ b/gpt_engineer/core/chat_to_files.py @@ -27,6 +27,7 @@ import os from pathlib import Path import re +import codecs from typing import List, Tuple @@ -159,7 +160,9 @@ def get_all_files_in_dir(directory): ), "Trying to edit files outside of the workspace" file_name = os.path.relpath(path, workspace.path) if file_name in workspace: - files_dict[file_name] = workspace[file_name] + with codecs.open(file_path, 'r', encoding='utf-8', errors='ignore') as file: + file_data = file.read() + files_dict[file_name] = file_data return files_dict