◐ Shell
reader mode source ↗
Skip to content

bpo-46659: Enhance LocaleTextCalendar for C locale#31214

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:calendar_c_locale
Feb 24, 2022
Merged

bpo-46659: Enhance LocaleTextCalendar for C locale#31214
vstinner merged 1 commit into
python:mainfrom
vstinner:calendar_c_locale

Conversation

@vstinner

@vstinner vstinner commented Feb 8, 2022

Copy link
Copy Markdown
Member

If the LC_TIME locale is "C", use the user preferred locale.

https://bugs.python.org/issue46659

@vstinner

vstinner commented Feb 8, 2022

Copy link
Copy Markdown
Member Author

If the LC_TIME locale is "C", use the user preferred locale.
@vstinner

Copy link
Copy Markdown
Member Author

@eryksun: I modified the implementation to only get the user preferred locale once, in the constructor. Is it better?

@vstinner

Copy link
Copy Markdown
Member Author

I tested manually the change on FreeBSD: it works, LC_TIME is also "C" at Python startup.

FreeBSD has a "POSIX" locale, but it's not used when LC_ALL, LC_CTYPE and LANG environment variable at not set: LC_CTYPE is "C" in this case.

@vstinner vstinner merged commit 4fccf91 into python:main Feb 24, 2022
@vstinner vstinner deleted the calendar_c_locale branch February 24, 2022 13:29
@vstinner

Copy link
Copy Markdown
Member Author

I merged my PR. Thanks @eryksun for your feedback and the nice idea of reusing with different_locale(""): to get the user preferred locale :-)

calendar should now be a little bit better in some corner cases, but for the regular use case, there should be no change between Python 3.10 and 3.11.

asvetlov pushed a commit that referenced this pull request Feb 26, 2022
If the LC_TIME locale is "C", use the user preferred locale.
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.

4 participants