René's URL Explorer Experiment


Title: fix: Python-Rust combining char diff in isalnum by joshuamegnauth54 · Pull Request #7612 · RustPython/RustPython · GitHub

Open Graph Title: fix: Python-Rust combining char diff in isalnum by joshuamegnauth54 · Pull Request #7612 · RustPython/RustPython

X Title: fix: Python-Rust combining char diff in isalnum by joshuamegnauth54 · Pull Request #7612 · RustPython/RustPython

Description: Closes: #7518 Rust and Python differ on alphanumeric characters. Rust follows the Unicode standard closer than Python. This means that is_alphanumeric (char function in Rust) is different from isalnum (Python). To fix the discrepancy, RustPython needs to mimic Python by rejecting certain characters. Some classes of combining characters count as alphanumeric in Rust but not Python. Combining characters are accent marks that are combined with other characters to create a single grapheme. It's possible that this PR is not exhaustive. I fixed the combining character issue BUT I don't know the full range of discrepancies. This doesn't actually fix #7518, but it fixes a similar issue based on that report. Actually, CodeRabbit pointed me in the right direction so now it does fix #7518. assert!('\u{006e}'.is_alphanumeric()); assert!(!'\u{0303}'.is_alphanumeric()); assert!('\u{00f1}'.is_alphanumeric()); assert!('\u{0345}'.is_alphanumeric()); for raw in 0x0363..=0x036f { let c = char::from_u32(raw).unwrap(); assert!(c.is_alphanumeric()); } assert '\u006e'.isalnum() assert not '\u0303'.isalnum() assert '\u00f1'.isalnum() assert not '\u0345'.isalnum() assert not '\u0363'.isalnum() for raw in range(0x0363, 0x036f): assert not chr(raw).isalnum() ^Note the differences which are accounted for by the new tests. Summary by CodeRabbit Bug Fixes Corrected str.isalnum() so standalone Unicode combining marks are not treated as alphanumeric, while base letters remain valid. Tests Expanded tests for str.isalnum() covering combining-character cases. Added regex test ensuring standalone combining marks are not matched as word characters.

Open Graph Description: Closes: #7518 Rust and Python differ on alphanumeric characters. Rust follows the Unicode standard closer than Python. This means that is_alphanumeric (char function in Rust) is different from isal...

X Description: Closes: #7518 Rust and Python differ on alphanumeric characters. Rust follows the Unicode standard closer than Python. This means that is_alphanumeric (char function in Rust) is different from isal...

Opengraph URL: https://github.com/RustPython/RustPython/pull/7612

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:10705c52-c47c-e82a-c9bc-ee59579fd49e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC126:37C180:34E5352:4921BE9:6A60DA6E
html-safe-nonce1a3bc8f5f4b3633d95ec1897216177a9d63301acfd8508f3ca146d4d9d5a2735
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTI2OjM3QzE4MDozNEU1MzUyOjQ5MjFCRTk6NkE2MERBNkUiLCJ2aXNpdG9yX2lkIjoiMTU5NTA0NjA2NjkwNzA0NDQ2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac32b3aa0a3de02399d0035e7aa050301f0d7bb8db240433d3363dd3f672af4adf
hovercard-subject-tagpull_request:3531209317
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7612/files
twitter:imagehttps://avatars.githubusercontent.com/u/48846352?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/48846352?s=400&v=4
og:image:altCloses: #7518 Rust and Python differ on alphanumeric characters. Rust follows the Unicode standard closer than Python. This means that is_alphanumeric (char function in Rust) is different from isal...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8302bdfafed4cf34ac9c1d3593108fafa53bc3f86b893907e38fa6bdd74361ac
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec3c2ff0c76b34772c83c9498a08cefee28f53da0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/7612/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7612%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7612%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/7612/files
Reloadhttps://github.com/RustPython/RustPython/pull/7612/files
Reloadhttps://github.com/RustPython/RustPython/pull/7612/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 293 https://github.com/RustPython/RustPython/issues
Pull requests 102 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
joshuamegnauth54:isalnum-combining-characterhttps://github.com/joshuamegnauth54/RustPython/tree/isalnum-combining-character
Conversation 14 https://github.com/RustPython/RustPython/pull/7612
Commits 2 https://github.com/RustPython/RustPython/pull/7612/commits
Checks 19 https://github.com/RustPython/RustPython/pull/7612/checks
Files changed https://github.com/RustPython/RustPython/pull/7612/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
fix: Python-Rust combining char diff in isalnum https://github.com/RustPython/RustPython/pull/7612/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/7612/files
647aa8e fix: Python-Rust combining char diff in isalnum joshuamegnauth54 Apr 14, 2026 https://github.com/RustPython/RustPython/pull/7612/commits/647aa8ef6a2c463176377a61ae6c1dcc97d8408f
f79d6df fix: Ignore combining characters in SRE joshuamegnauth54 Apr 15, 2026 https://github.com/RustPython/RustPython/pull/7612/commits/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe
Clear filters https://github.com/RustPython/RustPython/pull/7612/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
Cargo.lock https://github.com/RustPython/RustPython/pull/7612/files#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87e
Cargo.toml https://github.com/RustPython/RustPython/pull/7612/files#diff-4ec6547b40082b89f7e0ebf890a21d47137504bd8c166532102236ac0f2e4ec4
string.rs https://github.com/RustPython/RustPython/pull/7612/files#diff-02c1acfdbc47f1c203f53fcd964ecd4991e001d584d8905e1cee1a7eef88009d
str.rs https://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
builtin_str.py https://github.com/RustPython/RustPython/pull/7612/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
stdlib_re.py https://github.com/RustPython/RustPython/pull/7612/files#diff-516ae05455c2584ebca0fbf07ee77b992fe8f68f8fc7c621221e8442ced0d6af
Cargo.lockhttps://github.com/RustPython/RustPython/pull/7612/files#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87e
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/Cargo.lock
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
crates/sre_engine/Cargo.tomlhttps://github.com/RustPython/RustPython/pull/7612/files#diff-4ec6547b40082b89f7e0ebf890a21d47137504bd8c166532102236ac0f2e4ec4
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/crates/sre_engine/Cargo.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7612/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7612/files#diff-4ec6547b40082b89f7e0ebf890a21d47137504bd8c166532102236ac0f2e4ec4
https://github.com/RustPython/RustPython/pull/7612/files#diff-4ec6547b40082b89f7e0ebf890a21d47137504bd8c166532102236ac0f2e4ec4
crates/sre_engine/src/string.rshttps://github.com/RustPython/RustPython/pull/7612/files#diff-02c1acfdbc47f1c203f53fcd964ecd4991e001d584d8905e1cee1a7eef88009d
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/crates/sre_engine/src/string.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7612/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7612/files#diff-02c1acfdbc47f1c203f53fcd964ecd4991e001d584d8905e1cee1a7eef88009d
https://github.com/RustPython/RustPython/pull/7612/files#diff-02c1acfdbc47f1c203f53fcd964ecd4991e001d584d8905e1cee1a7eef88009d
https://github.com/RustPython/RustPython/pull/7612/files#diff-02c1acfdbc47f1c203f53fcd964ecd4991e001d584d8905e1cee1a7eef88009d
crates/vm/src/builtins/str.rshttps://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/crates/vm/src/builtins/str.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7612/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
coderabbitaihttps://github.com/apps/coderabbitai
Apr 16, 2026https://github.com/RustPython/RustPython/pull/7612/files#r3090643954
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://util.unicode.org/UnicodeJsps/character.jsp?a=093Fhttps://util.unicode.org/UnicodeJsps/character.jsp?a=093F
https://www.compart.com/en/unicode/U+093Fhttps://www.compart.com/en/unicode/U+093F
https://www.fileformat.info/info/unicode/char/93f/index.htmhttps://www.fileformat.info/info/unicode/char/93f/index.htm
https://www.unicode.org/Public/latest/ucd/UnicodeData.txthttps://www.unicode.org/Public/latest/ucd/UnicodeData.txt
https://graphemica.com/0303https://graphemica.com/0303
https://util.unicode.org/UnicodeJsps/character.jsp?a=0303https://util.unicode.org/UnicodeJsps/character.jsp?a=0303
https://www.compart.com/en/unicode/U+0303https://www.compart.com/en/unicode/U+0303
https://www.fileformat.info/info/unicode/char/0303/index.htmhttps://www.fileformat.info/info/unicode/char/0303/index.htm
https://codepoints.net/U+0303https://codepoints.net/U+0303
https://docs.python.org/3/library/stdtypes.html?highlight=str%20isalphanumhttps://docs.python.org/3/library/stdtypes.html?highlight=str%20isalphanum
https://docs.python.org/3/library/stdtypes.htmlhttps://docs.python.org/3/library/stdtypes.html
https://docs.python.org/3/c-api/unicode.htmlhttps://docs.python.org/3/c-api/unicode.html
https://github.com/python/cpython/blob/main/Objects/unicodectype.chttps://github.com/python/cpython/blob/main/Objects/unicodectype.c
https://github.com/python/cpython/blob/main/Objects/unicodeobject.chttps://github.com/python/cpython/blob/main/Objects/unicodeobject.c
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
https://github.com/RustPython/RustPython/pull/7612/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
extra_tests/snippets/builtin_str.pyhttps://github.com/RustPython/RustPython/pull/7612/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/extra_tests/snippets/builtin_str.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7612/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7612/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
ShaharNavehhttps://github.com/ShaharNaveh
Apr 16, 2026https://github.com/RustPython/RustPython/pull/7612/files#r3095302536
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
https://github.com/RustPython/RustPython/pull/7612/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
extra_tests/snippets/stdlib_re.pyhttps://github.com/RustPython/RustPython/pull/7612/files#diff-516ae05455c2584ebca0fbf07ee77b992fe8f68f8fc7c621221e8442ced0d6af
View file https://github.com/joshuamegnauth54/RustPython/blob/f79d6df5bb8fba3af09c1bf8023e6780c6079fbe/extra_tests/snippets/stdlib_re.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7612/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7612/files#diff-516ae05455c2584ebca0fbf07ee77b992fe8f68f8fc7c621221e8442ced0d6af
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7612/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.