Change calc_md5_with_blocking_retries to also except PermissionErrors #10868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your changes
Some IDEs and code editors may apply a lock when writing to files.
If auto-rerun is activated, the watcher triggers an acces to the file as soon as it detects a change.
This leads to a PermissionError when streamlit tries to access that file while the lock is still applied to it.
Adding the PermissionError to the excepted exception classes resolves this problem, as the lock will usually be released before the function reaches the maximum amount of execution attempts.
This PR essentially implements what was proposed in #4486.
GitHub Issue Link (if applicable)
#4486
Testing Plan
Although there is no actual change in functionality, the affected function now excepts a second exception class.
A corresponding unit test case might be needed.
Contribution License Agreement
By submitting this pull request I agree that all contributions to this project are made under the Apache 2.0 license.