Bugfix when resetting configuration#14894
Merged
Merged
Conversation
seanbudd
approved these changes
May 3, 2023
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.
Link to issue number:
Fixes #13187
Summary of the issue:
After having modified a parameter in a profile and then reset it to its original value with NVDA+control+C, it was not possible to save the configuration with NVDA+control+R; NVDA was complaining that the file system was probably read-only.
Description of user facing changes
NVDA will no longer refuse to save the configuration after a configuration reset.
Description of development approach
Bugfix: when resetting the config,
config.conf._dirtyProfilesis clearedI have also narrowed the exception filtering when saving the config since in #13187, we get a message related to file write error, whereas the real error had nothing to do with it: it was a
KeyErrorwhen trying to find "notepad" inconfig.conf._profileCache. I have filtered onPermissionErrorwhich is the error that I get when I setnvda.ini(or the whole NVDA setting folder) as read-only and try to save the config.Testing strategy:
Manual tests:
Test 1
Check that NVDA+control+R can still save the configuration in normal case
Test 2
Reproduce the steps in #13187 and check that we get expected result as described there.
Test 3
Set file
nvda.inior whole NVDA settings folder as read only and try to save the config with NVDA+shift+C. Check that we still get the error message.Test 4
ConfigManager.saveinconfig.__init__.py.Known issues with pull request:
None
Change log entries:
Bug fixes
NVDA will no longer refuse to save the configuration after a configuration reset. (#13187)Code Review Checklist: