Repository navigation
Align code introspection and monitoring with Python 3.15 - #9178
youknowone merged 4 commits into
Conversation
Preserve canonical qualified-name interning and subclass values, normalize valid debug-range tables, and correct event-specific monitoring disable and callback ownership boundaries. Assisted-by: OpenAI Codex:model version unavailable
Copy the missing test_monitoring dependency from pinned CPython 3.15.0 through scripts/update_lib, retaining existing suite guards. Assisted-by: OpenAI Codex:model version unavailable
Model active source instrumentation across all subscribed tools instead of unconditional legacy edge pairing. Preserve tool names during unlocked callback finalization before releasing them. Assisted-by: OpenAI Codex:model version unavailable
Retain decoded WTF8 qualnames, use exact-str marshal dispatch, and model wrapped branch dispatch with physical DISABLE sites. Retire the proven monitoring shutdown guard through update_lib. 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: 2
📒 Files selected for processing: 7
✨ 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: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (108 tests)
[x] test: cpython/Lib/test/test_monitoring.py (TODO: 3) dependencies: dependent tests: (no tests depend on monitoring) [ ] test: cpython/Lib/test/test_finalization.py dependencies: dependent tests: (no tests depend on finalization) (module 'bufio' not found) (module 'largefile' not found) [ ] lib: cpython/Lib/weakref.py dependencies:
dependent tests: (200 tests)
[ ] test: cpython/Lib/test/test_io (TODO: 10) dependencies: dependent tests: (no tests depend on file) (module 'fileio' not found) [ ] test: cpython/Lib/test/test_descr.py (TODO: 2) dependencies: dependent tests: (no tests depend on descr) (module 'memoryio' not found) [ ] test: cpython/Lib/test/test_gc.py (TODO: 4) dependencies: dependent tests: (174 tests)
(module 'univnewlines' not found) Legend:
|
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: 675826ba7a
ℹ️ 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".
| callbacks | ||
| }; | ||
| // Callback finalizers may reenter monitoring; release owners after unlocking. | ||
| drop(callbacks); |
There was a problem hiding this comment.
Re-clear reentrant event registrations after callback teardown
When a callback is kept alive only by the monitoring table and its __del__ calls set_events or set_local_events (and may re-register itself), this drop runs after clear_tool_id/free_tool_id have already cleared the tool's masks, so the destructor's new masks survive; free_tool_id can then leave a nameless tool with live callbacks/events, and immediate reuse inherits them. Re-clear the tool's masks after finalizers run while still dropping callback owners outside the lock.
Useful? React with 👍 / 👎.
|
|
||
| import sys | ||
|
|
||
| class CallableCycle: |
There was a problem hiding this comment.
Keep executable fixtures out of restricted test changes
Adding this class creates new executable test logic in Lib/test, but the repository's root instructions permit test-file changes only to add or remove @unittest.expectedFailure markers and their associated TODO comments. Restore the shutdown test's marker rather than adding this helper so the change stays within the allowed test-update policy.
AGENTS.md reference: AGENTS.md:L274-L282
Useful? React with 👍 / 👎.
Summary
Extract a coherent code-object metadata and monitoring compatibility batch from #8954, based directly on main at
fc9f4a9.co_qualnameobject semantics: exact strings are interned, string subclasses retain identity, and marshal round trips preserve WTF8 qualified names. Marshal keeps CPython's exact-string policy.no_debug_rangesconsistently and normalize valid signed location-table deltas without changing bytecode offsets. Unconvertible tables retain existing bytes; this is not a general malformed-table reader hardening change.scripts/update_liband retire only its genuinely executed, now-passing expectedFailure marker.Canonical source: CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc. Existing related canonical files were already present; no artificial Lib updates, duplicate snippets, or Python-behavior Rust tests are added. Merged function/type lifetime fixes remain intact.Validation
Current source:
675826ba7a.test_code: 42 total, 41 passed and 1 skipped. Candidate repositorytest_code: 37 total, 21 passed, 15 skipped, 1 existing expected failure.test_monitoring: 98 passed. Candidate repositorytest_monitoring: 98 total, 91 passed, 5 skipped, 2 existing expected failures. The shutdown helper ran successfully in a child interpreter before its marker was retired.test_marshal: 75 total, 59 passed, 15 skipped, 1 existing expected failure.test_sys_settrace: 448 total, 371 passed, 77 skipped.test_dis: 145 total, 119 passed, 26 skipped.test_types: 136 total, 132 passed, 2 skipped, 2 existing expected failures.Local gates bind source
675826ba7ato basefc9f4a9. Main advanced independently during validation; hosted merge-ref CI must establish integration with those landed changes before merge readiness. Local old-base test counts are not claimed as merged-tree results.The repository suites retain genuine unsupported C-extension/resource guards. C-API native coverage does not imply Python
_testcapiavailability. No CPU/network/bigmem resources were enabled.Scope limits
This does not claim complete monitoring parity for callback-time instrumentation replacement, cross-tool callback mutation/order, orphan/loop predecessor mapping, or reserved tracing/profiling instrumentation. Those inherited paths are not redesigned here. It also does not claim safe interpretation of arbitrary malformed location tables or lossless unrelated compiler-only string fields.
Baseline mismatches were retained and corrected against pinned source and oracle observations; no new test exclusions or altered assertions were used.
Assisted-by: OpenAI Codex:model version unavailable