Skip to content

fix: handle invalid CLI path inputs gracefully#5083

Open
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-invalid-cli-path-input
Open

fix: handle invalid CLI path inputs gracefully#5083
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-invalid-cli-path-input

Conversation

@Kcstring
Copy link
Copy Markdown

Summary

  • guard CLI file path resolution and directory checks against OSError
  • surface invalid path inputs via tool_error and exit with status 1 instead of crashing
  • add a regression test covering an overlong path input

Testing

  • python3 -m pytest tests/basic/test_main.py -k invalid_long_path
  • python3 -m pytest tests/basic/test_main.py -k "empty_dir_no_files_on_command or emptqy_dir_new_file or dname_and_fname"
  • python3 -m ruff check aider/main.py tests/basic/test_main.py

Fixes #5082

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncaught OSError in pathlib.py line 841

1 participant