-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
Support Unix-like locales on Windows #148792
Copy link
Copy link
Open
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
No status
Feature or enhancement
Windows supports locale names in different formats. Some of them look similar to Unix-like names. The
localemodule tries to convert locale names on Windows to Unix-like form. It does not try hard, sogetlocale()andsetlocale()can return something unusual. What is worse, Unix-like names are not always supported insetlocale(), even if the locale in principle is supported on Windows. See also #67613 and #87281.This issue is a continuation of #137729 on Windows. Linux and Unix in general support locales
ca_ES.utf8@valencia,sr_RS.utf8@latinanduz_UZ.utf8@cyrillic. Windows supports the same locales with namesca-ES-valencia,sr-Latn-RSanduz-Cyrl-UZ.setlocale()should map the former to the latter (of course it should continue to support the former).Linked PRs