Skip to content
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

repomap.get_tags_raw doesn't crash on UTF-16 files #313

Closed
wants to merge 1 commit into from

Conversation

nevercast
Copy link

Related to #305, Aider would crash while building a repomap when attempting to load a file with non UTF-16 content. This commit adds a try/except block that returns nothing back to the caller, allowing repomap to skip the file and continue.

Future considerations might be to use the read_file function in io.py

I've not run any tests other than ensuring that /tokens does not crash when a non UTF-8 file is present in the Git repo.

Related to Aider-AI#305, Aider would crash while building a repomap when attempting to load a file with non UTF-16 content. This commit adds a try/except block that returns nothing back to the caller, allowing repomap to skip the file and continue.

Future considerations might be to use the read_file function in `io.py`

I've not run any tests other than ensuring that `/tokens` does not crash when a non UTF-8 file is present in the Git repo.
@paul-gauthier
Copy link
Collaborator

Thanks for the PR. I took your suggestion and fixed this issue using io.read_text()

f0c575e

@nevercast nevercast deleted the patch-1 branch November 2, 2023 21:13
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.

2 participants