Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds error handler to change file permissions if delete fails #2474

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bitwise-constructs
Copy link
Contributor

@bitwise-constructs bitwise-constructs commented Jan 21, 2025

What I did

On windows, shutil.rmtree() will fail to delete directories if they contain a read-only file, which git can place and then fail to re-clone into the same destination.

How I did it

Adds an error handler that will change the file permissions to not be read-only

How to verify it

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added some notes, and now all we need is a good test

src/ape_pm/dependency.py Outdated Show resolved Hide resolved
src/ape/utils/os.py Outdated Show resolved Hide resolved
Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just needs a test ◡̈ i can help

@bitwise-constructs
Copy link
Contributor Author

Test is confirmed working on windows, thank you!

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