Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
vstinner merged 3 commits intopython:mainfromvstinner:alt_digits
May 22, 2025

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedMay 21, 2025
edited by bedevere-appbot
Loading

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.

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.
@vstinner
Copy link
MemberAuthor

cc@serhiy-storchaka

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. 👍 👏

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a 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.

@@ -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.

@bedevere-app
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@vstinner
Copy link
MemberAuthor

@serhiy-storchaka: I updated the PR, please review again.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. 👍

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@vstinnervstinner merged commit899c7dc intopython:mainMay 22, 2025
38 checks passed
@vstinnervstinner deleted the alt_digits branchMay 22, 2025 14:05
@miss-islington-app
Copy link

Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 22, 2025
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>
@bedevere-app
Copy link

GH-134512 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 22, 2025
vstinner added a commit that referenced this pull requestMay 22, 2025
…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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@vstinner@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp