Repository navigation
Audit special type attributes and instance class assignments - #9485
Conversation
Match CPython event and validation ordering through the shared special-attribute helper. Restore the canonical monkeypatch audit test with update_lib and preserve unrelated markers. Assisted-by: OpenAI Codex:model version unavailable
|
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 |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] test: cpython/Lib/test/test_sys.py (TODO: 4) dependencies: dependent tests: (249 tests)
Legend:
|
Merging this PR will not alter performance
Comparing Footnotes
|
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. |
Summary
Match CPython's
object.__setattr__audit events for special type attributes and instance__class__assignment, and restoreAuditTest.test_monkeypatchusingscripts/update_lib migrate.__name__,__qualname__,__module__,__bases__,__doc__,__type_params__) through the existing check helper: reject deletion/immutable types, emit the event with the exact value, then validate and mutate.__class__, reject deletion/non-type values before auditing; retain existing layout/mutability checks afterward.__qualname__invalid-value diagnostic without changing the constructor's shared helper. Preserve arbitrary__type_params__values, as CPython does.No audit framework, type layout, MRO/cache machinery, dependency or test-body changes. The updater removes only
test_monkeypatch's marker; unrelated markers remain unchanged. This is independent of #9483's marshal wrapper events despite sharingtest_audit.py.CPython basis
Validation
cargo check, strictcargo clippy -- -D warnings, andcargo buildpassed withthreading,stdlib,stdio,importlib,host_env,doc,ucd_3_2_0.__class__checks.test_auditmodule were not run locally; ordinary hosted CI must validate them. Full workspace/C-API tests were not run locally. Finite audit compatibility does not establish general type-layout, lifecycle or security-policy equivalence.AI assistance: OpenAI Codex assisted with source comparison, implementation and validation. Model version unavailable. Automated checks are not human review.