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-124969: Make locale.nl_langinfo(locale.ALT_DIGITS) returning a string again#125774

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

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedOct 21, 2024
edited by github-actionsbot
Loading

This is a follow up ofGH-124974. Only Glibc needed a fix. Now the returned value is a string consisting of semicolon-separated symbols on all Posix platforms.


📚 Documentation preview 📚:https://cpython-previews--125774.org.readthedocs.build/

… a string againThis is a follow up ofpythonGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.
@serhiy-storchaka
Copy link
MemberAuthor

@kulikjak, could you please test that the modified test is passed on Solaris?

kulikjak reacted with thumbs up emoji

@kulikjak
Copy link
Contributor

Hi@serhiy-storchaka, thanks!

I tested the patch, andlocale.nl_langinfo(locale.ALT_DIGITS) returns the same thing as before (which was the goal), and the tests now pass.

0:00:00 load avg: 1.98 [1/1] test__localetest_alt_digits_nl_langinfo (test.test__locale._LocaleTests.test_alt_digits_nl_langinfo) ...   test_alt_digits_nl_langinfo (test.test__locale._LocaleTests.test_alt_digits_nl_langinfo) (locale='ja_JP') ... skipped "ALT_DIGITS is not set for locale 'ja_JP' on this platform"  test_alt_digits_nl_langinfo (test.test__locale._LocaleTests.test_alt_digits_nl_langinfo) (locale='or_IN') ... skipped "ALT_DIGITS is not set for locale 'or_IN' on this platform"test_float_parsing (test.test__locale._LocaleTests.test_float_parsing) ... oktest_lc_numeric_basic (test.test__locale._LocaleTests.test_lc_numeric_basic) ... oktest_lc_numeric_localeconv (test.test__locale._LocaleTests.test_lc_numeric_localeconv) ... oktest_lc_numeric_nl_langinfo (test.test__locale._LocaleTests.test_lc_numeric_nl_langinfo) ... ok

There is currently no locale inknown_alt_digits that hasALT_DIGITS set on Solaris, so I added the following two:

    'ar_AE.UTF-8': (100, {0: '\u0660', 10: '\u0661\u0660', 99: '\u0669\u0669'}),    'bn_IN.UTF-8': (100, {0: '\u09e6', 10: '\u09e7\u09e6', 99: '\u09ef\u09ef'}),

(and adjusted those two incandidate_locales to include the*.UTF-8 suffix).

@serhiy-storchaka
Copy link
MemberAuthor

Is not ar_AE equivalent to ar_AE.UTF-8?

@kulikjak
Copy link
Contributor

Is not ar_AE equivalent to ar_AE.UTF-8?

Unfortunately not. Mostly due to historical reasons, default locales on Solaris are not UTF-8. And I guess that for similar reasons, only the UTF-8 variants of these two includeALT_DIGITS.

@kulikjak
Copy link
Contributor

Uh, so with this second change I found that 'ja_JP.PCK' on Solaris returns 101 symbols. At least those three tested match, which is nice.

The standard allows max 100, but considering that the last value is anew symbol (and not just a concatenation of those before), I can see why it is there. That said, I propose removing 'ja_JP.PCK' from tested locales (I don't think PCK is available on other platforms anyway).

serhiy-storchaka reacted with thumbs up emoji

@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)October 21, 2024 18:33
@serhiy-storchaka
Copy link
MemberAuthor

Thank you for your help@kulikjak.

kulikjak reacted with hooray emoji

@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 21, 2024
… a string again (pythonGH-125774)This is a follow up ofpythonGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.(cherry picked from commitdcc4fb2)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 21, 2024
… a string again (pythonGH-125774)This is a follow up ofpythonGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.(cherry picked from commitdcc4fb2)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-125804 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelOct 21, 2024
@bedevere-app
Copy link

GH-125805 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelOct 21, 2024
serhiy-storchaka added a commit that referenced this pull requestOct 21, 2024
…g a string again (GH-125774) (GH-125805)This is a follow up ofGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.(cherry picked from commitdcc4fb2)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull requestOct 21, 2024
…g a string again (GH-125774) (GH-125804)This is a follow up ofGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.(cherry picked from commitdcc4fb2)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
… a string again (pythonGH-125774)This is a follow up ofpythonGH-124974. Only Glibc needed a fix.Now the returned value is a string consisting of semicolon-separatedsymbols on all Posix platforms.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@kulikjak

[8]ページ先頭

©2009-2025 Movatter.jp