Skip to content

versioncheck: tolerate OSError when creating version-check marker#5103

Open
SAY-5 wants to merge 1 commit intoAider-AI:mainfrom
SAY-5:say5/version-check-permission-error-2865
Open

versioncheck: tolerate OSError when creating version-check marker#5103
SAY-5 wants to merge 1 commit intoAider-AI:mainfrom
SAY-5:say5/version-check-permission-error-2865

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #2865.

check_version's finally block called VERSION_CHECK_FNAME.parent.mkdir(parents=True, exist_ok=True) and touch() unconditionally. Sandboxes that leave HOME unset (or set it to /) end up resolving Path.home() to /, so VERSION_CHECK_FNAME is /.aider/caches/versioncheck and mkdir fails with PermissionError: [Errno 13] Permission denied: '/.aider'. The exception escapes through the finally and crashes aider on startup. The marker is purely an optimisation — wrap the two filesystem ops in a try / except OSError so a missing or unwritable home directory doesn't take aider down.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
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