Files
youknowdot 92204385cd Count the complete Windows locale encoding suffix (#9065)
Include modifiers in the 15-byte bound before calling the CRT, matching Python 3.14.

Assisted-by: OpenAI Codex:model identifier unavailable
2026-10-10 19:26:08 +00:00

15 lines
494 B
Python

import locale
import sys
from testutils import assert_raises
# Windows counts the modifier toward the code-page length before calling the CRT.
if sys.platform == "win32":
for category, name in (
(locale.LC_CTYPE, "English.1252@" + "x" * 16),
(locale.LC_ALL, "LC_CTYPE=English.1252@" + "x" * 16),
):
with assert_raises(locale.Error) as caught:
locale.setlocale(category, name)
assert caught.exception.args == ("unsupported locale setting",)