Repository navigation
Sync selected Python 3.15 core library tests and repr type errors - #9321
Conversation
Synchronize ten selected library paths from CPython 3.15.0 at d220409a13b77de7a6c30abe16ea90db01528edc using the canonical updater, retaining existing RustPython adapters and failure markers. Match generic __repr__ invalid-result errors to the qualified type-name format required by the canonical ExceptionGroup regression, preserving string results and exceptions raised by the implementation. Implementation, source review, and validation were AI-assisted. The model version identifier is unavailable; automated checks are not human verification. Bounded validation covers 43 passes and one canonical skip, not the full repository suites. Assisted-by: OpenAI Codex:model version unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 10
📒 Files selected for processing: 3
✨ 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 |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/platform.py dependencies:
dependent tests: (33 tests)
[ ] test: cpython/Lib/test/test_set.py (TODO: 2) dependencies: dependent tests: (no tests depend on set) [x] test: cpython/Lib/test/test_funcattrs.py (TODO: 1) dependencies: dependent tests: (no tests depend on funcattrs) [x] test: cpython/Lib/test/test_dict.py (TODO: 1) dependencies: dependent tests: (no tests depend on dict) [x] lib: cpython/Lib/codecs.py dependencies:
dependent tests: (186 tests)
[x] lib: cpython/Lib/json dependencies:
dependent tests: (19 tests)
[ ] test: cpython/Lib/test/test_exceptions.py (TODO: 2) dependencies: dependent tests: (no tests depend on exception) Legend:
|
Keep the original input length as consumed after successful unicode-escape and raw-unicode-escape decoding, including error-handler input replacement. Only report the current cursor when a non-final decode stops on incomplete input, matching CPython's codec wrappers and incomplete exits. Fix the canonical Unicode escape mutation regression that failed CI on Linux, macOS and Windows. Preserve all Lib tests and existing assertions. Bounded Linux validation: 55 passes and one canonical skip, CLI build and strict common/VM Clippy passed. Full repository suites were not run. Implementation, source review, and validation were AI-assisted. The model version identifier is unavailable; automated checks are not human verification. Assisted-by: OpenAI Codex:model version unavailable
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03e7da1dae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| '_json') | ||
|
|
||
|
|
||
| class TestModule(unittest.TestCase): |
There was a problem hiding this comment.
Include the JSON version check in
load_tests
When test_json is run through the normal module loader, this package's load_tests discards the loader-provided suite in _ and builds a fresh suite containing only doctests, TestPyTest, TestCTest, and discovered child modules. Since package discovery suppresses rediscovery of the package while its load_tests is active, TestModule.test_deprecated__version__ is never executed by the normal -m test test_json run; add this class to suite or retain the supplied tests so the new regression check actually runs.
Useful? React with 👍 / 👎.
Summary
Synchronize ten selected library paths with CPython 3.15.0 at d220409a13b77de7a6c30abe16ea90db01528edc, using the canonical updater and preserving existing RustPython adapters and expected-failure markers.
The synchronized ExceptionGroup regression exposed an actual main-RustPython failure: a non-string
__repr__result still produced__repr__ returned non-string (type NoneType)instead of the new qualified diagnostic. Update the generic Rust repr slot wrapper to emit{receiver_type}.__repr__() must return a str, not {result_type}, using the existing fully qualified type-name helper. Valid string results, including subclasses, and exceptions raised by__repr__retain their existing paths.The initial published head f128630 exposed another canonical regression in all three OS CI jobs:
test_mutating_decode_handler_unicode_escapereturned consumed length 4 after an error handler replaced an original six-byte buffer. The follow-up Rust fix retains the original input length on successful Unicode/raw-Unicode escape decoding and uses the current cursor only at existing incomplete non-final exits. This matches CPython's wrapper initialization and incomplete handling without changing buffer mutation, restart validation, warnings or canonical tests.The 13-file patch contains:
Lib/platform.pyand its tests: canonical normalization, deprecation and Python 3.15 API-removal changes.crates/vm/src/types/slot.rs.Upstream test assertions, cases and guards are preserved rather than rewritten to accommodate RustPython. The canonical deep-ExceptionGroup stack guards and removal of the deprecated Java platform test come from the pinned CPython source; no local skip, xfail or assertion weakening was introduced to make the selected tests pass.
Validation
Linux, pinned Rust toolchain 1.99.1, with the candidate built from main Rust code plus this patch, not the separate vectorcall candidate:
cargo build --locked --offline --bin rustpython: passed.cargo clippy --locked --offline -p rustpython-common -p rustpython-vm --lib -- -D warnings: passed on the codec-fix source; earlier VM-only lint also passed on the repr source.load_tests.test__comparable_versioncanonically skipped.test_repr_raisesand its raised-exception propagation branch.Before the Rust fix, the same synchronized Lib files produced 5 passes, one canonical skip and the real
test_repr_raisesassertion failure; the original remaining 28 selectors were not run after that failure. Those results were retained. After rebuilding with the repr fix, all original 35 selectors and nine additional existing repr regressions ran under a new source/binary binding (43 passes and one canonical skip). The subsequent published f128630 CI failure in the Unicode mutation method was retained, not hidden by this bounded result. After the codec fix, all those 44 selectors plus twelve existing codec selectors ran under a separate fresh binding (55 passes and one canonical skip). The earlier initial build was interrupted without a terminal receipt; the successful retry and later fixed-source build reused verified owned compilation cache, not an unrelated binary.Runtime source/tool/binary bindings, module-origin checks, per-ID accounting and resource checks passed in every completed fixed-source gate. The follow-up commit 03e7da1 has all 3,715 tracked file/link contents and modes independently verified against the final tested source manifest. Validation receipts retain their original pre-commit HEAD/status bindings; this is committed-source equivalence, not a claimed post-commit rerun.
Not run: complete affected-module suites, full workspace tests, separate
crates/capitests, release-profile validation, all-feature/build matrices, local Windows/macOS/WASM or other non-Linux checks. Earlier CI on f128630 failed the codec mutation case on Linux, macOS and Windows; a fresh CI result for the follow-up commit is not yet verified and is not implied by these Linux checks. These bounded results do not establish full Python 3.15 compatibility or whole-repository validation.Relationship to other work
Fresh main was still e5554e23abfbaee85508c32fc22e5074f88aebdd when checked on October 23.
Among these ten Lib paths, only
Lib/test/test_platform.pyoverlaps #8954. This is not ten extractions from that PR. The generic repr fix is new; #8954, #9320 and other open slot-related work touch differentslot.rsareas. #6215 touches separatetest_set.pyhunks. This is a source-overlap review, not a merge-conflict simulation; related work may need reconciliation when landing.AI assistance
OpenAI Codex assisted source synchronization/review, the Rust diagnostic and codec-accounting fixes, validation, and this PR description. The model version identifier is unavailable. These are automated checks, not a claim of human testing. The commit includes
Assisted-by: OpenAI Codex:model version unavailable.