aider
aider copied to clipboard
Fix: Handle OSError when git config lock fails on network drives
Problem
When using aider on network drives or with certain file system configurations, the repo.config_writer() call can fail with an OSError due to file locking issues. This causes aider to crash during the git setup phase.
Solution
- Wrapped the
config_writer()call in a try-except block to catchOSErrorandPermissionError - Added informative warning message that explains the issue and provides manual workaround
- Allows aider to continue in read-only mode instead of crashing
- Added test case to verify the error handling
Testing
- Added
tests/basic/test_git_config_network.pywith test coverage for the error scenario - Test mocks the OSError and verifies graceful handling
Fixes #4508