Title: Order parser warnings for valid source while preserving recovery boundaries by youknowdot · Pull Request #9296 · RustPython/RustPython · GitHub
Open Graph Title: Order parser warnings for valid source while preserving recovery boundaries by youknowdot · Pull Request #9296 · RustPython/RustPython
X Title: Order parser warnings for valid source while preserving recovery boundaries by youknowdot · Pull Request #9296 · RustPython/RustPython
Description: Summary Split from #8954 for Python 3.15.0. Reuse the existing parser-warning collector for ordinary compilation when parsing succeeds and tokenizer recovery is eligible. This orders numeric/string warnings by source position, visits annotation escapes before default escapes, and visits nonraw string expressions inside raw f-strings. After a parser-origin warning becomes an error, retain tokenizer completion so a later numeric error still takes precedence. Malformed source and tokenizer-origin interpolated warnings retain the previous path unchanged. This does not include broad malformed-source recovery, numeric-warning location and source-text metadata, filename/callback changes from #9282, or the separate raw module-object adaptation from #9294. Existing Rust tests and all Lib files are unchanged. Bounded validation Against pinned CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc), the fixed 24-row compile-only comparison gives: Exact agreement: 10/24, up from 7/24. Ordered-warning/error-choice agreement: 18/24, up from 13/24. Exactly five intended rows change: mixed escape-first warning order, annotation/default order under both filters, and raw-f inner-string handling under both filters. All 8/8 fallback rows remain exactly equal to baseline. This is not full metadata parity: numeric positions, SyntaxError args/repr, and nonnumeric terminal-newline differences remain recorded. No compiled input was executed, and no full Python modules were run. Passed: debug CLI build; VM checks with parser enabled/disabled and threading; test-target compilation (not execution); strict all-target VM Clippy; changed-file hooks. Sealed baseline was reused. Artifact/provenance checks passed. Cost and scope Warning-free valid compilation still uses one warning-prepass parse, with an additional Barry-future substring scan. Inherited/in-source Barry flags and fallback paths can require additional parsing/scanning. No compile-time benchmark or performance claim is made. Prepared with AI assistance (OpenAI Codex). Summary by CodeRabbit Bug Fixes Compiler warnings are now grouped together when the source has valid syntax and can be safely recovered. Existing escape-related warning information is preserved. For invalid syntax or unsafe recovery, existing warning behavior remains unchanged. AST-only and interactive compilation continue to follow their mode-specific recovery behavior.
Open Graph Description: Summary Split from #8954 for Python 3.15.0. Reuse the existing parser-warning collector for ordinary compilation when parsing succeeds and tokenizer recovery is eligible. This orders numeric/string...
X Description: Summary Split from #8954 for Python 3.15.0. Reuse the existing parser-warning collector for ordinary compilation when parsing succeeds and tokenizer recovery is eligible. This orders numeric/string...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9296
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ef304f38-d666-e71b-7791-27190217f01b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CFE2:D1D28:1554500:1C4F44A:6B01FE23 |
| html-safe-nonce | b0d33acdc059652b5aebd75a359cad8d843abfc7762264ebace378524bc22431 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkUyOkQxRDI4OjE1NTQ1MDA6MUM0RjQ0QTo2QjAxRkUyMyIsInZpc2l0b3JfaWQiOiI1OTc0MzU3MTQ0Njk3NDM3NzMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 45b0e0ad8785bcc6ebac6660682e343c411d12f265980bc6f644ba7b7d1ae40b |
| hovercard-subject-tag | pull_request:4963415535 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9296/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Split from #8954 for Python 3.15.0. Reuse the existing parser-warning collector for ordinary compilation when parsing succeeds and tokenizer recovery is eligible. This orders numeric/string... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width