Python to 3.13.14#20476
Open
dpy013 wants to merge 5 commits into
Open
Conversation
Bump the pinned CPython version used across the project from 3.13.13 to 3.13.14. Changes: - .python-versions: update cpython-3.13.13-windows-x86_64-none to cpython-3.13.14-windows-x86_64-none - runtime-builders/synthDriverHost32/.python-version: update cpython-3.13.13-windows-x86-none to cpython-3.13.14-windows-x86-none - .github/workflows/autofix.yml: update python-version from 3.13.13 to 3.13.14 - .github/workflows/fetch-crowdin-translations.yml: update python-version from 3.13.13 to 3.13.14 - .github/workflows/testAndPublish.yml: update defaultPythonVersion and supportedPythonVersions from 3.13.13 to 3.13.14 - projectDocs/dev/createDevEnvironment.md: update documented Python version requirement from 3.13.13 to 3.13.14 Signed-off-by: dpy013 <26911141+dpy013@users.noreply.github.com>
seanbudd
reviewed
Jul 10, 2026
| # check that the language codes are correctly set for the thread | ||
| self.assertEqual( | ||
| langOnly, | ||
| WINDOWS_LOCALE_ALIASES.get(langOnly, langOnly), |
Member
There was a problem hiding this comment.
I don't think this is the correct fix.
windows_locale is being removed in Python 3.13 as per python/cpython#144738
Instead we need to remove using windows_locale and use winKernel.LCIDToLocaleName instead. This involves changing languageHandler.windowsLCIDToLocaleName, removing _LCIDS_TO_TRANSLATED_LOCALES_OVERRIDES
def windowsLCIDToLocaleName(lcid: int) -> str | None:
"""
Gets a normalized locale from a Windows LCID.
NVDA should avoid relying on LCIDs in future, as they have been deprecated by MS:
https://docs.microsoft.com/en-us/globalization/locale/locale-names
"""
localeName = LCIDS_TO_TRANSLATED_LOCALES.get(lcid)
if not localeName:
localeName = winKernel.LCIDToLocaleName(lcid)
if localeName:
return normalizeLanguage(localeName)
dpy013
added a commit
to dpy013/nvda
that referenced
this pull request
Jul 10, 2026
As per reviewer feedback on PR nvaccess#20476, locale.windows_locale is being deprecated and removed in Python 3.13 (see cpython#144738). This commit removes NVDA's dependency on it in languageHandler.windowsLCIDToLocaleName. Changes: - Remove _LCIDS_TO_TRANSLATED_LOCALES_OVERRIDES (no longer needed since we're not using locale.windows_locale) - Simplify windowsLCIDToLocaleName to check LCIDS_TO_TRANSLATED_LOCALES first, then use winKernel.LCIDToLocaleName (Windows API) - Update LCIDS_TO_TRANSLATED_LOCALES docstring to reflect its new purpose - Revert WINDOWS_LOCALE_ALIASES workaround in test_languageHandler.py (no longer needed since LCIDS_TO_TRANSLATED_LOCALES already has 1170: "ckb", which correctly maps LCID 0x0492 to "ckb") This fixes the ckb locale test failure because when Windows returns LCID 0x0492 for Central Kurdish, windowsLCIDToLocaleName now checks LCIDS_TO_TRANSLATED_LOCALES first and returns "ckb" directly, matching what the test expects. References: - Python cpython#144738: python/cpython#144738 - PR nvaccess#20476 discussion: nvaccess#20476 (comment)
fix Co-authored-by: Sean Budd <seanbudd123@gmail.com>
fix Co-authored-by: Sean Budd <seanbudd123@gmail.com>
As per reviewer feedback on PR nvaccess#20476, locale.windows_locale is being deprecated and removed in Python 3.13 (see cpython#144738). This commit removes NVDA's dependency on it in languageHandler.windowsLCIDToLocaleName. Changes: - Remove _LCIDS_TO_TRANSLATED_LOCALES_OVERRIDES (no longer needed since we're not using locale.windows_locale) - Simplify windowsLCIDToLocaleName to check LCIDS_TO_TRANSLATED_LOCALES first, then use winKernel.LCIDToLocaleName (Windows API) - Update LCIDS_TO_TRANSLATED_LOCALES docstring to reflect its new purpose - Revert WINDOWS_LOCALE_ALIASES workaround in test_languageHandler.py (no longer needed since LCIDS_TO_TRANSLATED_LOCALES already has 1170: "ckb", which correctly maps LCID 0x0492 to "ckb") This fixes the ckb locale test failure because when Windows returns LCID 0x0492 for Central Kurdish, windowsLCIDToLocaleName now checks LCIDS_TO_TRANSLATED_LOCALES first and returns "ckb" directly, matching what the test expects. References: - Python cpython#144738: python/cpython#144738 - PR nvaccess#20476 discussion: nvaccess#20476 (comment)
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.
In Python 3.13.13, these entries did not exist, so
ckbwas classified as an unsupported Windows language and the locale assertion intest_NVDASupportedLanguages_LanguageIsSetCorrectlywas skipped. In Python 3.13.14,ckbis now recognized by Windows (LCID0x0492), but Windows maps it toku_IQ(language codeku) rather thanckb, causing the test assertion'ckb' != 'ku'to fail.### Description of user facing changes:
None. This is an internal Python version bump and test fix with no user-facing behavior changes.
### Description of developer facing changes:
- The pinned CPython version is now 3.13.14 across all build configurations, CI workflows, and developer documentation.
WINDOWS_LOCALE_ALIASESmapping is introduced intests/unit/test_languageHandler.pyto handle cases where Windows returns a different but related language code than the one NVDA uses. Future locale mismatches can be resolved by adding entries to this dictionary.### Description of development approach:
1. Updated Python version from 3.13.13 to 3.13.14 in:
.python-versions(root, x86_64)runtime-builders/synthDriverHost32/.python-version(x86).github/workflows/autofix.yml.github/workflows/fetch-crowdin-translations.yml.github/workflows/testAndPublish.yml(defaultPythonVersionandsupportedPythonVersions)projectDocs/dev/createDevEnvironment.mdckblocale test failure by adding aWINDOWS_LOCALE_ALIASESdictionary intests/unit/test_languageHandler.pythat mapsckb→ku, and updated the thread locale assertion to useWINDOWS_LOCALE_ALIASES.get(langOnly, langOnly)instead oflangOnly.References:
Python 3.13.14
Lib/locale.pyPython 3.13.13
Lib/locale.pyMS-LCID specification
Python 3.13.14 release notes
### Testing strategy:
- CI run on
dpy013/nvdabranchpy3.13.14: all jobs pass after the fix (Build, unit tests, Pyright type check, license check, translator comments, symbols).The
WINDOWS_LOCALE_ALIASESmapping is designed to be extensible — if similar locale mismatches surface on different Windows versions, new entries can be added without modifying test logic.### Known issues with pull request:
None.
### Code Review Checklist:
action run:
https://github.com/dpy013/nvda/actions/runs/29052432147