Skip to content

No longer call setlocale from nvda launcher, rely on languageHandler instead#9323

Merged
michaelDCurran merged 3 commits into
nvaccess:masterfrom
BabbageCom:i8726
Mar 28, 2019
Merged

No longer call setlocale from nvda launcher, rely on languageHandler instead#9323
michaelDCurran merged 3 commits into
nvaccess:masterfrom
BabbageCom:i8726

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #8726

Summary of the issue:

Newer versions of Windows 10 contain strange mixtures of locales, I.E. English (Netherlands). These locales are unknown to python, and therefore locale.setLocale fails with a locale.Error.

Description of how this pull request fixes the issue:

IN nvda.pyw and nvda_slave.pyw, locale.setlocale was called without catching possible errors. It is also called from core.py as part of languageHandler.setLanguage.

We now no longer call locale.setlocale, and when installing the gettext function, we rely on locale.getdefaultlocale.

Testing performed:

This at least fixes the case when selecting locales like English (Netherlands).

Here is a try build. @bramd, could you have a test as well?

Known issues with pull request:

None

Change log entry:

@josephsl

josephsl commented Feb 25, 2019 via email

Copy link
Copy Markdown
Contributor

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Python 3 does not suffer from this issue.

@bramd

bramd commented Feb 25, 2019

Copy link
Copy Markdown
Contributor

Seems to solve the issue here.

@michaelDCurran michaelDCurran merged commit 37dfca6 into nvaccess:master Mar 28, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.1 milestone Mar 28, 2019
@michaelDCurran michaelDCurran modified the milestones: 2019.1, 2019.2 Mar 31, 2019
@LeonarddeR LeonarddeR added the BabbageWork Pull requests filed on behalf of Babbage B.V. label Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BabbageWork Pull requests filed on behalf of Babbage B.V.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA fails to start if Windows is set to an unsupported/impossible locale

5 participants