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

Update rm_rf function to force remove directories #13270

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

Conversation

ayushjariyal
Copy link

closes #13269
In previous rm_rf function Uses shutil.rmtree(path, onerror=onerror), which recursively deletes everything, handling errors via onerror.

Now i update the rm_rf function to Explicitly walks the directory tree bottom-up (topdown=False) and removes files first, then subdirectories before deleting the main directory.

Now there are no more warnings after passing all tests.

Screenshot from 2025-03-03 01-00-05

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.

pytest: garbage cannot be removed [Errno 39]
1 participant