Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Morridin
Copy link
Contributor

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.

Some IDEs and code editors may apply a lock when writing files which makes streamlit run into a PermissionError when trying to access an application file while the lock is applied on the file.
Adding the PermissionError to the excepted exception classes avoids this problem to occur.
@snyk-io
Copy link
Contributor

snyk-io bot commented Mar 20, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@kajarenc kajarenc added impact:internal PR changes only affect internal code change:bugfix PR contains bug fix implementation security-assessment-completed Security assessment has been completed for PR labels Mar 21, 2025
@sfc-gh-kjavadyan sfc-gh-kjavadyan merged commit 50f7709 into streamlit:develop Mar 24, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:internal PR changes only affect internal code security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants