Skip to content

gh-152905: Decode LC_TIME items in nl_langinfo() from glibc wide data#152911

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-152905-nl-langinfo-wide
Open

gh-152905: Decode LC_TIME items in nl_langinfo() from glibc wide data#152911
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-152905-nl-langinfo-wide

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 2, 2026

Copy link
Copy Markdown
Member

On glibc, decode the LC_TIME items from the wide (_NL_W*) locale data, so the result no longer depends on the LC_CTYPE encoding.

The wide constant is always _NL_W + the narrow name, so it is filled into langinfo_constants[] by token pasting — one scan yields both the item and its wide form. ERA has no wide counterpart and keeps the narrow path.

🤖 Generated with Claude Code

…e data

On glibc, locale.nl_langinfo() now decodes the LC_TIME text items from the
wide (_NL_W*) locale data, independently of the LC_CTYPE encoding.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33416059 | 📁 Comparing e03cae6 against main (31864bd)

  🔍 Preview build  

2 files changed
± library/locale.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka requested a review from vstinner July 2, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant