Skip to content

fix: read gitignore files as utf-8#5090

Open
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-gitignore-utf8-watch
Open

fix: read gitignore files as utf-8#5090
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-gitignore-utf8-watch

Conversation

@Kcstring
Copy link
Copy Markdown

Summary

  • Read watcher gitignore files with explicit UTF-8 decoding instead of the platform default encoding
  • Use replacement for malformed bytes so file watching does not crash on decode errors
  • Add a regression test that simulates a Windows cp1252 default while reading a UTF-8 gitignore

Testing

  • python3 -m pytest tests/basic/test_watch.py
  • python3 -m ruff check aider/watch.py tests/basic/test_watch.py

Fixes #2888

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 UnicodeDecodeError in cp1252.py line 23

1 participant