mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-10 22:55:00 +00:00
Merge pull request #2692 from mdklab/fix-issue-1802-unicode-error
Fix issue #1802: Handle UnicodeDecodeError in repo file paths
This commit is contained in:
commit
9befec5cd1
2 changed files with 46 additions and 0 deletions
|
@ -393,6 +393,12 @@ def sanity_check_repo(repo, io):
|
|||
if not repo.git_repo_error:
|
||||
return True
|
||||
error_msg = str(repo.git_repo_error)
|
||||
except UnicodeDecodeError as exc:
|
||||
error_msg = (
|
||||
f"Failed to read the Git repository. This issue is likely caused by a path encoded "
|
||||
f"in a format different from the expected encoding \"{sys.getfilesystemencoding()}\".\n"
|
||||
f"Internal error: {str(exc)}"
|
||||
)
|
||||
except ANY_GIT_ERROR as exc:
|
||||
error_msg = str(exc)
|
||||
bad_ver = "version in (1, 2)" in error_msg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue