Skip to content

locale.setlocale() crashes on Windows for long locale name #137273

@serhiy-storchaka

Description

@serhiy-storchaka

Crash report

locale.setlocale(locale.LC_CTYPE, 'ks_IN.UTF-8@devanagari') crashes.
locale.setlocale(locale.LC_CTYPE, 'ks_IN.UTF8@devanagari') just raises a locale.Error.

It's not just about length. Standard locale names in Windows (like 'English_United States.1252') are pretty long.

Tested and reproduced in 3.12, 3.13, 3.14, and main, on Windows 10.

Linked PRs

Metadata

Metadata

Labels

3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesOS-windowsextension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions