Skip to content

Support Unix-like locales on Windows #148792

@serhiy-storchaka

Description

@serhiy-storchaka

Feature or enhancement

Windows supports locale names in different formats. Some of them look similar to Unix-like names. The locale module tries to convert locale names on Windows to Unix-like form. It does not try hard, so getlocale() and setlocale() can return something unusual. What is worse, Unix-like names are not always supported in setlocale(), 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@latin and uz_UZ.utf8@cyrillic. Windows supports the same locales with names ca-ES-valencia, sr-Latn-RS and uz-Cyrl-UZ. setlocale() should map the former to the latter (of course it should continue to support the former).

Linked PRs

Metadata

Metadata

Labels

3.15new features, bugs and security fixesOS-windowsstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions