From dfc8c613994ed326c587397d52e0d0624267004a Mon Sep 17 00:00:00 2001 From: Ruijian-Zha <55631456+Ruijian-Zha@users.noreply.github.com> Date: Mon, 2 Oct 2023 20:36:17 -0400 Subject: [PATCH 1/2] Fix TypeError in file_selector.py Updated file_selector.py to handle WindowsPath objects by converting them to strings before joining. This resolves the TypeError encountered when trying to join WindowsPath objects directly. --- gpt_engineer/file_selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpt_engineer/file_selector.py b/gpt_engineer/file_selector.py index 8865f545ff..4fb90edc5a 100644 --- a/gpt_engineer/file_selector.py +++ b/gpt_engineer/file_selector.py @@ -292,7 +292,7 @@ def ask_for_files(metadata_db: DB, workspace_db: DB) -> None: sys.exit(1) if not selection_number == 3: - metadata_db[FILE_LIST_NAME] = "\n".join(file_path_list) + metadata_db[FILE_LIST_NAME] = "\n".join(str(file_path) for file_path in file_path_list) def gui_file_selector(input_path: str) -> List[str]: From 2f8e762529bc46a70fffe071032aacf09b4cbf3b Mon Sep 17 00:00:00 2001 From: Ruijian-Zha <1323318674@qq.com> Date: Mon, 2 Oct 2023 20:57:41 -0400 Subject: [PATCH 2/2] Fixing TypeError in file_selector.py In the gpt-engineer project, a TypeError was encountered in file_selector.py when attempting to join WindowsPath objects directly. The error occurred as the code expected a string instance, but received a WindowsPath instance instead. To rectify this, the line of code was updated to convert WindowsPath objects to strings before joining. This change resolves the TypeError while maintaining the original functionality of the code, ensuring that the program can handle file paths correctly across different operating systems. --- gpt_engineer/file_selector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpt_engineer/file_selector.py b/gpt_engineer/file_selector.py index 4fb90edc5a..ed5a90ab79 100644 --- a/gpt_engineer/file_selector.py +++ b/gpt_engineer/file_selector.py @@ -292,7 +292,9 @@ def ask_for_files(metadata_db: DB, workspace_db: DB) -> None: sys.exit(1) if not selection_number == 3: - metadata_db[FILE_LIST_NAME] = "\n".join(str(file_path) for file_path in file_path_list) + metadata_db[FILE_LIST_NAME] = "\n".join( + str(file_path) for file_path in file_path_list + ) def gui_file_selector(input_path: str) -> List[str]: