Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS)#134468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Set the LC_CTYPE locale to the LC_TIME locale even ifnl_langinfo(ALT_DIGITS) result is ASCII. The result is a listseparated by NUL characters and the code only checks the first listitem which can be ASCII whereas following items are non-ASCII.Fix test__locale for the uk_UA locale on RHEL 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. 👍 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ALT_DIGITS may be not defined.
Modules/_localemodule.c Outdated
@@ -692,7 +692,8 @@ _locale_nl_langinfo_impl(PyObject *module, int item) | |||
result = result != NULL ? result : ""; | |||
char *oldloc = NULL; | |||
if (langinfo_constants[i].category != LC_CTYPE | |||
&& !is_all_ascii(result) | |||
// gh-133740: Always change the locale for ALT_DIGITS | |||
&& (item == ALT_DIGITS || !is_all_ascii(result)) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
When you're done making the requested changes, leave the comment: |
Uh oh!
There was an error while loading.Please reload this page.
@serhiy-storchaka: I updated the PR, please review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. 👍
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
899c7dc
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Set the LC_CTYPE locale to the LC_TIME locale even ifnl_langinfo(ALT_DIGITS) result is ASCII. The result is a listseparated by NUL characters and the code only checks the first listitem which can be ASCII whereas following items are non-ASCII.Fix test__locale for the uk_UA locale on RHEL 7.(cherry picked from commit899c7dc)Co-authored-by: Victor Stinner <vstinner@python.org>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-134512 is a backport of this pull request to the3.14 branch. |
…4512)gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (GH-134468)Set the LC_CTYPE locale to the LC_TIME locale even ifnl_langinfo(ALT_DIGITS) result is ASCII. The result is a listseparated by NUL characters and the code only checks the first listitem which can be ASCII whereas following items are non-ASCII.Fix test__locale for the uk_UA locale on RHEL 7.(cherry picked from commit899c7dc)Co-authored-by: Victor Stinner <vstinner@python.org>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
Set the LC_CTYPE locale to the LC_TIME locale even if nl_langinfo(ALT_DIGITS) result is ASCII. The result is a list separated by NUL characters and the code only checks the first list item which can be ASCII whereas following items are non-ASCII.
Fix test__locale for the uk_UA locale on RHEL 7.