Skip to content

Commit

Permalink
Merge pull request #756 from Ruijian-Zha/main
Browse files Browse the repository at this point in the history
I'm considering merging this, but maybe there is a more appropriate place to make the fix. Both the gui and the terminal file selectors (I don't know which one you are using) are supposed to return List[str], and clearly they don't. Can you do the convert to string already in the selector functions and then maybe do a test on all created strings that they indeed are valid paths, along the lines of:
def is_valid_path(path: str) -> bool:
    try:
        os.stat(path)
        return True
    except OSError:
        return False
  • Loading branch information
ATheorell authored Oct 4, 2023
2 parents a09d222 + 2f8e762 commit c5ac0fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gpt_engineer/file_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(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]:
Expand Down

0 comments on commit c5ac0fc

Please sign in to comment.