Repository navigation
Match tokenizer token metadata with CPython 3.15 - #9445
Merged
youknowone merged 2 commits intoOct 29, 2026
Merged
youknowone merged 2 commits into
youknowone merged 2 commits into
Conversation
Assisted-by: OpenAI Codex: model version unavailable
Contributor
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
Contributor
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/tokenize.py dependencies:
dependent tests: (175 tests)
Legend:
|
Assisted-by: OpenAI Codex: model version unavailable
youknowone
approved these changes
Oct 29, 2026
youknowone
marked this pull request as ready for review
October 29, 2026 04:34
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CTokenizeTest.test_asyncandTestTokenize.test_newline_and_space_at_the_end_of_the_source_without_newlineexpected-failure markers through actualscripts/update_lib migratefrom CPythond220409a13b77de7a6c30abe16ea90db01528edc. The remaining invalid-syntax and resource-dependent random-files markers remain unchanged.This is a focused native tokenizer plus its dependent Lib test update, separate from the free-threading aggregate and builtin-construction changes. It does not change lexer grammar, callback ownership or the tokenizer's Reading/Yielding synchronization. The free-threading tokenizer module remains outside this patch.
Validation
cargo checkand strict Clippy passed; one guarded final executable build passed.64e701982b3bad37b03c0a16b68a485682bed9527ba629db51dfa0425aaaa55a, built from main8c6c94b07174224517b6bf62abab202565382ea7plus this native change. All 607 recorded native inputs were verified.CTokenizeTest.test_async,test_function,test_tabs,test_unicode, andTokenizeTest.test_basic. The additional full canonical newline-space method passed separately. Both complete updater-generated methods then passed together (2 tests, no skips or expected failures).The follow-up corrects the non-extra INDENT location after an explicit continuation and classifies a complete leading-zero decimal token as NUMBER only in extra-token mode when its exact Ruff diagnostic identifies that token. Both complete canonical methods now pass; their markers were retired through actual update_lib migration.
These finite checks do not establish complete tokenizer or invalid-input parity. No full-module/workspace/CAPI, concurrency, reentry, crash, GC or stress test was run. Existing callback-state ownership and other tokenizer expected failures remain separate work.
AI assistance
OpenAI Codex assisted with implementation, source review, validation and this description.
Follow-up: continuation, leading-zero tokens and UTF-8 EOF line lookup
The original c178 head failed the canonical pyrepl double-width-character test because EOF line lookup used the last byte rather than a UTF-8 character boundary. The follow-up selects the final character's byte offset and shares that lookup between both EOF-line callsites. It does not change Ruff, lexer grammar, callback ownership or the free-threading tokenizer state machine.
Final protected executable SHA-256:
468375918b727a3c74d81772620eba1ca4a25c386c28ad9c3c43b3de15399a5c. Scoped check, strict Clippy and one guarded final build passed; all 607 native inputs were verified. Evidence on this final corrected executable:TestCursorPosition.test_cursor_position_double_width_character, using its synthetic event and mock console. This verifies the exact previously failing test locally; the full pyrepl module was not run locally.scripts/update_lib migratefrom the pinned source retired only the additional continuation-indentation and leading-zero expected-failure decorators. Both complete generated methods passed on the same protected executable, with no skips or expected failures. The remaining two markers are unchanged.The extra Unicode comparison failure stopped the initial driver before the canonical selections; the already-reviewed canonical methods were then run separately with their own successful receipts. No blanket Unicode/tokenizer parity or new-head CI success is claimed. No concurrency, FT, deep-nesting, random-file, GC, profiler or crash-stress suite was run.