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

Error when saving configuration #13187

Closed
CyrilleB79 opened this issue Dec 22, 2021 · 1 comment · Fixed by #14894
Closed

Error when saving configuration #13187

CyrilleB79 opened this issue Dec 22, 2021 · 1 comment · Fixed by #14894
Milestone

Comments

@CyrilleB79
Copy link
Collaborator

Steps to reproduce:

  • Create a profile for Notepad and use default profile for Windows Explorer
  • Focus the Notepad
  • Modify a configuration parameter, e.g. press NVDA+P to modify symbol level.
  • Press NVDA+control+R to restore to saved configuration
  • Alt+Tab to Windows Explorer
  • Modify a configuration parameter, e.g. press NVDA+P to modify symbol level.
  • Press NVDA+control+C to save the current configuration.

Actual behavior:

A dialog appears with the following message:
"Cannot save configuration - file system is probably write protected"

Expected behavior:

No error message and configuration saved correctly.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2021.3.1

Windows version:

Windows 10 2004 (x64) build 19041.388

Name and version of other software in use when reproducing the issue:

N/A

Other information about your system:

N/A

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Not tested

Here is the log:
log.txt

@feerrenrut
Copy link
Contributor

I don't think this is a regression, certainly something to fix though.
Looks like something is holding onto the notepad profile key, from the log:

INFO - config.ConfigManager.save (22:19:34.803) - MainThread (7008):
Base configuration saved
WARNING - config.ConfigManager.save (22:19:34.803) - MainThread (7008):
Error saving configuration; probably read only file system
DEBUGWARNING - config.ConfigManager.save (22:19:34.803) - MainThread (7008):
Traceback (most recent call last):
  File "config\__init__.pyc", line 538, in save
KeyError: 'notepad'

seanbudd pushed a commit that referenced this issue May 3, 2023
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._dirtyProfiles is cleared

I 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 KeyError when trying to find "notepad" in config.conf._profileCache. I have filtered on PermissionError which is the error that I get when I set nvda.ini (or the whole NVDA setting folder) as read-only and try to save the config.
@nvaccessAuto nvaccessAuto modified the milestone: 2023.2 May 3, 2023
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 a pull request may close this issue.

3 participants