Skip to content

fix(filesystem): remove read-only files in recursive delete and overwrite - #515

Merged
Jeomon merged 1 commit into
CursorTouch:mainfrom
jaeminbird:fix-delete-readonly
Oct 29, 2026
Merged

Jeomon merged 1 commit into
CursorTouch:mainfrom
jaeminbird:fix-delete-readonly

Conversation

@jaeminbird

Copy link
Copy Markdown
Contributor

shutil.rmtree stops at the first read-only file, and Git marks the files under .git/objects read-only, so delete(recursive=True) can't remove a cloned repository on Windows and suggests an elevated terminal, which doesn't help. Directory overwrite in copy/move hits the same wall. The three rmtree calls now clear the read-only attribute and retry, as rd /s does; single-file delete is unchanged, and locked files still report Permission denied.

  • New tests fail on main and pass on Windows (Python 3.14); a real git init + git gc repo that failed on main now deletes.
  • uv run --extra dev pytest passes and ruff check is clean.

@Jeomon
Jeomon merged commit 66690fd into CursorTouch:main Oct 29, 2026
1 check failed
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.

2 participants