René's URL Explorer Experiment


Title: Align all remaining error messages with CPython by JamesClarke7283 · Pull Request #7993 · RustPython/RustPython · GitHub

Open Graph Title: Align all remaining error messages with CPython by JamesClarke7283 · Pull Request #7993 · RustPython/RustPython

X Title: Align all remaining error messages with CPython by JamesClarke7283 · Pull Request #7993 · RustPython/RustPython

Description: Summary Continues the parser error-message alignment from #7928 / #7933 / #7988. Translates many more ruff ParseErrorType variants to CPython 3.14.5's exact wording in CompileError::from_ruff_parse_error (using the source slice / parsed AST kind), plus a few codegen/symtable checks. crates/vm/src/stdlib/_ast.rs now routes its parse errors through from_ruff_parse_error, so ast.parse() / compile(..., PyCF_ONLY_AST) produce the same CPython-aligned messages as the exec path (they previously leaked raw ruff strings — and this fixes a regression where the var-param message diverged on the AST path). What's aligned aug-assign / delete / set / dict / f-string / t-string assignment targets cannot use {attribute,subscript,tuple,list,literal,function call} as import target; import X from Y → "Did you mean to use 'from ... import ...' instead?" string-prefix incompatibility ('u' and 'b' prefixes are incompatible); invalid character 'X' (U+XXXX) parenthesized def/lambda params; missing default / argument value; dict : and value syntax 'elif' block follows an 'else' block; raise from; comprehension if / unparenthesized target; ternary statement-keyword hints match case … as → cannot use {kind} as pattern target, and case … as _ → cannot use '_' as a target __debug__ as a def/class/type-param/except-handler name → cannot assign to __debug__ name 'x' is nonlocal and global; generic type-parameter wording (… cannot be used within the definition of a generic) This drops the now-passing # TODO: RUSTPYTHON; Wrong error message doctest markers and @expectedFailure decorators across test_syntax.py, test_genexps.py, test_named_expressions.py, and test_patma.py. Not covered (intentionally left marked) A few test_syntax.py cases need ruff-parser or deeper codegen changes and remain marked rather than emitting a silently-wrong message: the type-comment bare * case, class C(x for x in L) and f((x)=2) (ruff accepts these without a parse error), and dict(...); x $ y (duplicate-keyword vs lexer ordering). Runtime-error messages in unrelated subsystems (struct-sequence, format-spec, datetime, __import__, ast __replace__) are out of scope for this parser-focused change. Verification cargo clippy -p rustpython-compiler -p rustpython-codegen -- -D warnings clean; cargo fmt. Every changed message diff-tested against CPython 3.14.5 through both the exec path and ast.parse(). test_syntax test_genexps test_named_expressions test_patma test_type_params test_scope test_grammar test_compile test_exceptions all pass (961 tests). 🤖 Generated with Claude Code Summary by CodeRabbit Bug Fixes Reject the reserved identifier debug in more assignment, function/class, keyword-arg and type-parameter contexts Disallow using the wildcard _ as a capture/store target Prevent conflicting global/nonlocal declarations More CPython-aligned and clearer syntax/compile error messages; improved parse/compile error reporting and wording Chores Minor lint/implementation adjustments and a WASM import linkage hint for host imports

Open Graph Description: Summary Continues the parser error-message alignment from #7928 / #7933 / #7988. Translates many more ruff ParseErrorType variants to CPython 3.14.5's exact wording in CompileError::from_ruff_p...

X Description: Summary Continues the parser error-message alignment from #7928 / #7933 / #7988. Translates many more ruff ParseErrorType variants to CPython 3.14.5's exact wording in CompileError::from_ru...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:51df877d-0ff6-13bc-98c8-973627d5bd4b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE3DE:2E8FB4:43FDD33:59C94FC:6A5D6573
html-safe-nonce38c73a322b7dd13aa5c4191d8ef1b8c7763454d26cfe960d640dd2dfa0095594
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0RFOjJFOEZCNDo0M0ZERDMzOjU5Qzk0RkM6NkE1RDY1NzMiLCJ2aXNpdG9yX2lkIjoiMTMyOTY0Mzc4MTIzNTc2MjU0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac29be3b00c5a8c15d4c59705f8575dcf0e42238acd0082747ddab05192a4ab400
hovercard-subject-tagpull_request:3767477913
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/7993/files
twitter:imagehttps://avatars.githubusercontent.com/u/78018345?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/78018345?s=400&v=4
og:image:altSummary Continues the parser error-message alignment from #7928 / #7933 / #7988. Translates many more ruff ParseErrorType variants to CPython 3.14.5's exact wording in CompileError::from_ruff_p...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
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
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/7993/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7993%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
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%2F7993%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/7993/files
Reloadhttps://github.com/RustPython/RustPython/pull/7993/files
Reloadhttps://github.com/RustPython/RustPython/pull/7993/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/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
JamesClarke7283https://github.com/JamesClarke7283
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
JamesClarke7283:align-aug-assign-delete-set-dict-errorshttps://github.com/JamesClarke7283/RustPython/tree/align-aug-assign-delete-set-dict-errors
Conversation 25 https://github.com/RustPython/RustPython/pull/7993
Commits 7 https://github.com/RustPython/RustPython/pull/7993/commits
Checks 26 https://github.com/RustPython/RustPython/pull/7993/checks
Files changed https://github.com/RustPython/RustPython/pull/7993/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/files
Align all remaining error messages with CPython https://github.com/RustPython/RustPython/pull/7993/files#top
Show all changes 7 commits https://github.com/RustPython/RustPython/pull/7993/files
be45903 Align more parser/SyntaxError messages with CPython 3.14.5 JamesClarke7283 May 29, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/be45903b73c114bdbd234f78c10760ef3d307559
e6b1f7b Fix wasm32_without_js link error: declare host fns as `env` imports JamesClarke7283 May 29, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/e6b1f7b6ec456d2885e897467aa9f9cdfe301084
8ea3d32 Lib/test: drop now-passing expectedFailure markers JamesClarke7283 May 29, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/8ea3d32e41a4b537da0aee527d1e79758c2b6f12
2e00518 codegen: extract validate_type_params_no_debug helper JamesClarke7283 May 29, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/2e005182e97ab43db092f4ecc129f68029cf06b7
d53af6f Update crates/compiler/src/lib.rs JamesClarke7283 May 30, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/d53af6f86821db87cdba3823f40f2522cd3b2f12
deb8e72 codegen: align star/double-comma display errors with CPython JamesClarke7283 May 31, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/deb8e72ad9b0a15b1c40c24f729e83567547e13a
669fc00 Fix star/dict-value SyntaxError false-positives vs CPython 3.14.5 JamesClarke7283 Jun 1, 2026 https://github.com/RustPython/RustPython/pull/7993/commits/669fc00aeeab9c828f16529d4a8043c0c7b8bd43
Clear filters https://github.com/RustPython/RustPython/pull/7993/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/files
test_dictcomps.py https://github.com/RustPython/RustPython/pull/7993/files#diff-8f21b8d95ee7ccf12ae6a9954a01f79d1f62b64a0e98c6b1b293a82afb7ea4bb
test_fstring.py https://github.com/RustPython/RustPython/pull/7993/files#diff-8c1fe2af639c01d0d8e2368a8ab4ed407b1df4a3411e273b3fd5d0278ceb7393
test_genexps.py https://github.com/RustPython/RustPython/pull/7993/files#diff-a3205c859ed6f425793aae708507b8218ec29dfb1fc2fdff1a42eaeb810fd002
test_named_expressions.py https://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
test_patma.py https://github.com/RustPython/RustPython/pull/7993/files#diff-490b4f3b911cb4ca281e9ca6ff814bc10d331f0421f6c6971b08d9f29020620b
test_syntax.py https://github.com/RustPython/RustPython/pull/7993/files#diff-985c9f5237c42a342864f5cbdb35dc56bc0017f44d5dfa561ecbef72e4a7ad4f
test_unicode_identifiers.py https://github.com/RustPython/RustPython/pull/7993/files#diff-552f6ef61230168689e64ca06e23af7ab83752828eb66ebfab54b8be74631c0c
compile.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-6a53a11ca0aa1a372032c6b54644b8cda74af0c771efa40d3668da4a042cf7ca
symboltable.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-7e251aa58ffb659d1cf1ee90837d9e467e5c3e1c699f5c1e42655c2f03489b12
lib.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-560e1ff98a1fe1161356b6c726aeb89f8c5e9764ccd2f4fb4dfa7143508d09e7
_ast.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-abdef7b5c5b2a09ab3af5a77d683e79ae937bd93b5411799efd4101aacbc7411
builtins.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-ce8bd80bb61ce870dbf04415913693df814ebda260d3fc784b689a657e694ca3
vm_new.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-0ed409205fe13b41775e66f6be22c13146e9aebf1000a069a10b39293f219a7b
lib.rs https://github.com/RustPython/RustPython/pull/7993/files#diff-0b3c31074edbb02b920786548f52b58eff4ea04b9028f31933364d054960c9ea
Lib/test/test_dictcomps.pyhttps://github.com/RustPython/RustPython/pull/7993/files#diff-8f21b8d95ee7ccf12ae6a9954a01f79d1f62b64a0e98c6b1b293a82afb7ea4bb
View file https://github.com/RustPython/RustPython/blob/669fc00aeeab9c828f16529d4a8043c0c7b8bd43/Lib/test/test_dictcomps.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7993/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7993/files#diff-8f21b8d95ee7ccf12ae6a9954a01f79d1f62b64a0e98c6b1b293a82afb7ea4bb
https://github.com/RustPython/RustPython/pull/7993/files#diff-8f21b8d95ee7ccf12ae6a9954a01f79d1f62b64a0e98c6b1b293a82afb7ea4bb
Lib/test/test_fstring.pyhttps://github.com/RustPython/RustPython/pull/7993/files#diff-8c1fe2af639c01d0d8e2368a8ab4ed407b1df4a3411e273b3fd5d0278ceb7393
View file https://github.com/RustPython/RustPython/blob/669fc00aeeab9c828f16529d4a8043c0c7b8bd43/Lib/test/test_fstring.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7993/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7993/files#diff-8c1fe2af639c01d0d8e2368a8ab4ed407b1df4a3411e273b3fd5d0278ceb7393
https://github.com/RustPython/RustPython/pull/7993/files#diff-8c1fe2af639c01d0d8e2368a8ab4ed407b1df4a3411e273b3fd5d0278ceb7393
Lib/test/test_genexps.pyhttps://github.com/RustPython/RustPython/pull/7993/files#diff-a3205c859ed6f425793aae708507b8218ec29dfb1fc2fdff1a42eaeb810fd002
View file https://github.com/RustPython/RustPython/blob/669fc00aeeab9c828f16529d4a8043c0c7b8bd43/Lib/test/test_genexps.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7993/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7993/files#diff-a3205c859ed6f425793aae708507b8218ec29dfb1fc2fdff1a42eaeb810fd002
https://github.com/RustPython/RustPython/pull/7993/files#diff-a3205c859ed6f425793aae708507b8218ec29dfb1fc2fdff1a42eaeb810fd002
Lib/test/test_named_expressions.pyhttps://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
View file https://github.com/RustPython/RustPython/blob/669fc00aeeab9c828f16529d4a8043c0c7b8bd43/Lib/test/test_named_expressions.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7993/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
https://github.com/RustPython/RustPython/pull/7993/files#diff-4a4a4c48508e5753e128a68e37d611bf80f7847375cfa8445eb32e44f96f604b
Lib/test/test_patma.pyhttps://github.com/RustPython/RustPython/pull/7993/files#diff-490b4f3b911cb4ca281e9ca6ff814bc10d331f0421f6c6971b08d9f29020620b
View file https://github.com/RustPython/RustPython/blob/669fc00aeeab9c828f16529d4a8043c0c7b8bd43/Lib/test/test_patma.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7993/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7993/files#diff-490b4f3b911cb4ca281e9ca6ff814bc10d331f0421f6c6971b08d9f29020620b
https://github.com/RustPython/RustPython/pull/7993/files#diff-490b4f3b911cb4ca281e9ca6ff814bc10d331f0421f6c6971b08d9f29020620b
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7993/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.