Skip to content

Handle unwritable version check cache#5091

Open
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-versioncheck-cache-permission
Open

Handle unwritable version check cache#5091
Kcstring wants to merge 1 commit intoAider-AI:mainfrom
Kcstring:fix-versioncheck-cache-permission

Conversation

@Kcstring
Copy link
Copy Markdown

Fixes #2865.

The version check currently writes ~/.aider/caches/versioncheck in a finally block. In Docker/user setups where HOME resolves to an unwritable location such as /, that cache write can raise PermissionError and crash startup even though the version check itself is non-critical.

This change wraps the cache write in a small helper and ignores OSError by default. In verbose mode it reports the skipped cache write as a warning.

Local verification:

  • python3 -m pytest tests/basic/test_versioncheck.py
  • ruff check aider/versioncheck.py tests/basic/test_versioncheck.py
  • ruff format --check aider/versioncheck.py tests/basic/test_versioncheck.py

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 PermissionError in pathlib.py line 1175

1 participant