fix: catch exceptions when clearing addon store download directory on init#19776
Closed
seang1121 wants to merge 2 commits intonvaccess:masterfrom
Closed
fix: catch exceptions when clearing addon store download directory on init#19776seang1121 wants to merge 2 commits intonvaccess:masterfrom
seang1121 wants to merge 2 commits intonvaccess:masterfrom
Conversation
Member
|
Closing. This PR seems fully AI generated without human review or consideration. Please fill out our PR template rather than using your own/AI template. Please ensure you perform and confirm proper testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #19202
Summary
When the
_dl(addon store download) directory exists but has broken permissions (e.g. caused by a cloud backup tool like Google Drive locking the folder),shutil.rmtreeraises aPermissionErrorthat propagates uncaught through module initialisation. Because this happens at import time, NVDA crashes immediately with aCRITICAL - core failure, then the watchdog restarts it — creating a crash loop with no recovery path.The fix wraps the
rmtree+mkdirblock in atry/exceptthat logs the error withlog.exceptionand continues. The add-on store may not be fully functional without a clean download directory, but NVDA itself will start successfully and the user can investigate.Changes
source/addonStore/network.py: wrap the download directory cleanup and creation in a try/except insideAddonFileDownloader.__init__Test plan
_dldirectory (%appdata%\nvda\addonStore\_dl) and confirm NVDA starts without crashinglog.exceptionin the NVDA log