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
Config.conf: If an invalid value string is found for a setting, NVDA throws errors and does not reset the setting to its default value #4941
Comments
Comment 1 by jteh on 2015-02-23 07:06
It'd be good if you can explain the real life motivation for this. Did some add-on do something like this recently? I'll grant that if we're going to throw an error, it should be an explanatory one; StopIteration is not explanatory. For example, we report a useful error here:
As you say, this too would require a list of possible values to validate against. |
Comment 2 by nvdakor on 2015-02-23 07:47 |
cc @josephsl |
@josephsl, I guess this is still the case. Right? Maybe it should be considered further while moving to Python 3. |
Hi, or rather, when we use ConfigObj 5.1.0 features. CC @jcsteh
From: Adriani90 <notifications@github.com>
Sent: Saturday, January 19, 2019 5:37 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Config.conf: If an invalid value string is found for a setting, NVDA throws errors and does not reset the setting to its default value (#4941)
@josephsl <https://github.com/josephsl> , I guess this is still the case. Right? Maybe it should be considered further while moving to Python 3.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#4941 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkKqWDquVd-p-kx2OrVx-3IdOu1WKks5vE8hJgaJpZM4SF7Lo> .
|
Now that configobj 5.1.0 is integrated, maybe there are some features which would help to solve this. |
@josephsl is the issue still present? With the (incomplete) example provided in the initial description, the error is not the same:
Maybe because this parameter has changed in the config spec recently? If the issue is still present, could you provide a representative recent example for clarity, as well as the expected result? Thanks. |
Hi, Try config.conf["keyboard"]["keyboardLayout"] = "classic". With this set, keyboard layout combo box value will not be selected from keyboard settings panel. This behavior, while not that great, is an improvement over iteration issue I reported almost nine years ago. Threfore, I think we can close this with a new issue to be created to deal with combo box value issue. Thanks. |
Reported by nvdakor on 2015-02-23 06:40
Hi,
Consider the following scenario: A user or an add-on changes a setting via config.conf dictionary, and it happens that the value type for a particular key (setting) is a string (validate.check("string"). If the user or an add-on provides an unexpected string value for a particular setting, NVDA will say "stop iteration" next time one attempts to open the preferences dialog which contains the just modified setting.
STR:
The expected strings are "focus" and "review", with the focus set as the default value.
2. Try opening the braille settings dialog.
Expected/ideal: NVDA will detect that an unexpected string value was encountered in tether to list and will revert to the default setting.
Actual: NVDA throws stop iteration exception with that exception not being handled.
Short term solution: for affected settings (such as tether to setting in braille settings), provide a try block that catches and reverts the setting to factory defaults. This means one needs to consult the config module to locate the default string values and do:
Long term solution: in ConfigObj, one can specify a list of options in conficspec. This will force people or code to be restricted as to which value strings are acceptable. In addition, a check should be made when presenting a setting which has strings for values to make sure unexpected values are caught and dealt with (preferably to restore default value for that setting).
Thanks.
The text was updated successfully, but these errors were encountered: