No longer call setlocale from nvda launcher, rely on languageHandler instead#9323
Merged
Conversation
…ndler setting the locale
Contributor
|
Hi, the million dollar question is: will this survive Python 3 transition, especially Python 3.7 and 3.8? Thanks.
From: Leonard de Ruijter <notifications@github.com>
Sent: Monday, February 25, 2019 5:16 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] No longer call setlocale from nvda launcher, rely on languageHandler instead (#9323)
Link to issue number:
Fixes #8726 <#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 <https://ci.appveyor.com/api/buildjobs/uqstx4b5jugkatuj/artifacts/output%2Fnvda_snapshot_try-i8726-16840%2Cc7719165.exe> . @bramd <https://github.com/bramd> , could you have a test as well?
Known issues with pull request:
None
Change log entry:
* Bug fixes
* NVDA no longer fails to start when the users regional settings are set to a locale unknown to NVDA, such as English (Netherlands). (#8726 <#8726> )
…_____
You can view, comment on, or merge this pull request online at:
#9323
Commit Summary
* No longer call setlocale at NVDA start, rather rely on the languageHandler setting the locale
File Changes
* M source/nvda.pyw <https://github.com/nvaccess/nvda/pull/9323/files#diff-0> (4)
* M source/nvda_slave.pyw <https://github.com/nvaccess/nvda/pull/9323/files#diff-1> (3)
Patch Links:
* https://github.com/nvaccess/nvda/pull/9323.patch
* https://github.com/nvaccess/nvda/pull/9323.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#9323> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkK_z2-MJZD73qv0tlI66xiCtuUO8ks5vQ-HygaJpZM4bP2BU> .
|
Collaborator
Author
|
Python 3 does not suffer from this issue. |
Contributor
|
Seems to solve the issue here. |
michaelDCurran
approved these changes
Mar 28, 2019
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 #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: