test(str): add regression test for isprintable() unicode 15 chars,#7766
Conversation
📝 WalkthroughWalkthroughA unit test ChangesTest Coverage for isprintable() Unicode Handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
IMO yes, we can open a ticket about it. perhaps even mark it as a "good first issue" |
Fixes #7525
This PR adds a regression test for #7525.
At the time the issue was reported (commit 1a9b10e), str.isprintable() was returning False for '\u0b55' while CPython returns True.
The root cause was that rustpython_literal::char::is_printable() was using unic-ucd-category 0.9.0, which is based on Unicode 10.0 data. U+0B55 was unassigned (Cn) in Unicode 10.0, so it was incorrectly treated as non-printable.
This has since been fixed by migrating to icu_properties 2.2.0, which uses up-to-date Unicode data and correctly classifies U+0B55 as Mn (Nonspacing Mark), making it printable.
Summary by CodeRabbit