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

Catch ValueErrors thrown when attempting to remove a file twice #3314

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

Jake-Carter
Copy link
Contributor

Fixes #3313

This PR catches ValueError to improve the safety of the list.remove calls, as they may attempt to remove the same file multiple times.

I think this is more acceptable than...

if a in files: files.remove(a)

... because files can be a really large list to iterate across.

@oprypin
Copy link
Contributor

oprypin commented Jul 27, 2023

Thanks. I thought it would be impossible for it to try to delete the same file twice, and anyway if there are 3 files, it should delete 2 of them rather than just catch an error from deleting 1 file twice. So I should look for a better fix but this is good for now

@oprypin oprypin merged commit 86cde7b into mkdocs:master Jul 27, 2023
15 checks passed
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.

v1.5.0 Attempts to Remove Files Twice, throws ValueError
2 participants