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-60462: Fix locale.strxfrm() on Solaris#138242

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

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedAug 29, 2025
edited by bedevere-appbot
Loading

It should interpret the result of wcsxfrm() as a sequence of abstract integers, not a sequence of Unicode code points or using other encoding scheme that does not preserve ordering.

It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.
@serhiy-storchakaserhiy-storchaka changed the titleFix locale.strxfrm()gh-138247: Fix locale.strxfrm()Aug 29, 2025
@serhiy-storchaka
Copy link
MemberAuthor

!buildbot Solaris

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@serhiy-storchaka for commit60a5481 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F138242%2Fmerge

The command will test the builders whose names match following regular expression:Solaris

The builders matched are:

  • SPARCv9 Oracle Solaris 11.4 PR

@StanFromIreland
Copy link
Member

test_locale now passes!

0:10:12 load avg: 17.86 [438/492/7] test_locale passed

@serhiy-storchakaserhiy-storchaka changed the titlegh-138247: Fix locale.strxfrm()gh-138247: Fix locale.strxfrm() on SolarisAug 30, 2025
@serhiy-storchakaserhiy-storchaka marked this pull request as ready for reviewAugust 30, 2025 07:09
@kulikjak
Copy link
Contributor

Thanks! I tested the patch on Solaris on both SPARC and Intel, and the tests are happy with it.

That said, I am unsure whether it's correct to split the codes only when they are longer than 16 bits - couldn't that break the ordering?

for example with values0x100FF and0xF

  • 0x100FF gets split into0x1 and0xFF
  • 0xF remains unchanged

-> comparing element by element,0x1 < 0xF, but that would not be the case without the split

@kulikjak
Copy link
Contributor

@serhiy-storchaka
Copy link
MemberAuthor

Note| 0x10000u.0x100FF gets split into0x10001 and0xFF. It is larger than any unchanged value.

@serhiy-storchaka
Copy link
MemberAuthor

BTW, we are using similar patch on Solaris:

Yes, it is surprisingly similar. You don't need to add 0x10000 if you split every character. My implementation needs this because it leaves 16-bit codes unchanged (this saves memory and time).

More important,PyUnicode_FromWideChar() should not be used here, because it changes order on Solaris.

@serhiy-storchakaserhiy-storchaka changed the titlegh-138247: Fix locale.strxfrm() on Solarisgh-60462: Fix locale.strxfrm() on SolarisSep 2, 2025
@kulikjak
Copy link
Contributor

Note| 0x10000u.0x100FF gets split into0x10001 and0xFF. It is larger than any unchanged value.

Oh, I completely overlooked that| 0x10000u; part - thanks for pointing that out.

More important,PyUnicode_FromWideChar() should not be used here, because it changes order on Solaris.

That's true. I don't know if in can change order in our case, but it certainly shouldn't go through thatHAVE_NON_UNICODE_WCHAR_T_REPRESENTATION specific conversion we have there.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@serhiy-storchakaserhiy-storchaka merged commit482fd0c intopython:mainSep 3, 2025
49 checks passed
@serhiy-storchakaserhiy-storchaka deleted the locale-strxfrm branchSeptember 3, 2025 12:49
@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsSep 3, 2025
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 3, 2025
It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.(cherry picked from commit482fd0c)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 3, 2025
It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.(cherry picked from commit482fd0c)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelSep 3, 2025
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 3, 2025
serhiy-storchaka added a commit that referenced this pull requestSep 3, 2025
It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.(cherry picked from commit482fd0c)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
lkollar pushed a commit to lkollar/cpython that referenced this pull requestSep 9, 2025
It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.
encukou pushed a commit that referenced this pull requestOct 8, 2025
It should interpret the result of wcsxfrm() as a sequence of abstractintegers, not a sequence of Unicode code points or using other encodingscheme that does not preserve ordering.(cherry picked from commit482fd0c)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

@vstinnervstinnervstinner approved these changes

+1 more reviewer

@kulikjakkulikjakkulikjak approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@serhiy-storchaka@bedevere-bot@StanFromIreland@kulikjak@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp