-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: aider
crashes on files with non-ASCII characters (when building the repository map)
#82
Comments
Note: I have close to no knowledge about python. This issue was largely written by ChatGPT, with me driving it via |
Thanks for trying aider, and sorry you ran into this issue. And thank you for such an excellent bug report including a sample repo to reproduce the bug! I just made a PR that attempts to fix the root cause, which is that
There is a git config setting to disable this behavior. Aider now invokes
|
Ok, that turned out to be way more complicated than expected on Windows. Thanks again for pointing out this issue. Hopefully the fixes should make aider much more robust to all sorts of unusual filenames. |
Thanks for fixing it so quickly! I tested the new version, it works 🥳 .
Regards from Germany Christoph |
I'm still struggling with this same issue on MacOS. Aider works perfectly up until I add to the git repo, then it becomes unusable due to over 10k red alerts about encodings. I've spent hours trying to fix the issue including eg with "git config --global core.quotepath off" and adding various directories by .gitignore. No joy. As breadcrumbs, I've found a workaround is to individually add directories like my /scripts instead of using 'git add .'. It would be great if anyone comes up with further ideas. |
Description
When
aider
attempts to call therun_ctags
function on a git repository containing filenames with non-ASCII characters, it crashes with aFileNotFoundError
. The error message indicates that the filename passed toos.path.getmtime
in therun_ctags
function contains escaped non-ASCII characters (\\303\\274
), which is likely causing the issue.Steps to Reproduce
doc/fänny_dirname/README.md
), or clone such a repository (demo repo: https://github.com/cgrothaus/sample-repo-demonstrate-aider-bug-special-filenames).aider
on the repository./tokens
command, which causes the repo map to be built.aider
crashes with this error output:Expected Behavior
aider
should correctly handle filenames with non-ASCII characters and not crash when calling therun_ctags
function.Actual Behavior
aider
crashes with aFileNotFoundError
when calling therun_ctags
function on a repository containing filenames with non-ASCII characters. The error message indicates that the filename passed toos.path.getmtime
contains escaped non-ASCII characters.Possible Solution
Ensure that the filename is correctly encoded and escaped at all points in the code where it's used. This might involve changing how the filename is read from the file system, how it's stored in the cache, and how it's passed to the
ctags
command.Additional Context
This issue was discovered during a chat session with
aider
. The issue occurs regardless of the specific non-ASCII characters in the filenames.The text was updated successfully, but these errors were encountered: