Summary
Address five API paths not covered by the open signature PRs, based directly on main 4242849852:
- Generate
socket.sendmsg defaults and address from its argument declaration.
- Generate SQLite
adapt's protocol default and backup's 0.25 spelling.
- Reuse the Connection parameter declaration for
sqlite3.connect, preserving CPython's custom-factory forwarding, including missing or duplicate database arguments, unknown keywords, and unconverted values. The adapter moves the original arguments without binding or copying them again.
- Implement the watchdog's keyword-only
max_threads: negative caps truncate immediately, zero uses 100, positive caps limit emitted threads, and an exact count does not add an ellipsis.
No raw-text override is introduced. Existing #9758 handles Clinic line wrapping. #9775 independently corrects timeout keyword acceptance. When combining these branches, preserve both sets of tests in the newly added stdlib_faulthandler.py (an add/add conflict) and add max_threads: 100 to #9775's WatchdogState unit-test initializer.
Inventory
A fresh CPython 3.15.1 comparison of 16,227 observed API paths on Linux found 109 raw-signature differences with default features and 112 with sqlite. Additional RustPython signatures where CPython has none are allowed and excluded from those counts.
Existing PRs cover 105 of the 112 paths: #9758 (61 layout differences), #9756 (24 legacy groups/CSV), #9763 (14 interpreter functions), #9773 (four legacy signatures), and #9551 (two sched_param paths).
This patch changes the five remaining socket/SQLite/watchdog paths. It also exposes Connection's signature through the reused metadata, an allowed additional signature. On this independent branch, exact raw differences decrease 112 to 110: sendmsg and adapt become exact; connect/backup still need #9758's wrapping, and the watchdog still needs #9775's keyword correction plus wrapping. No observed paths are added or removed.
The two uncovered APIs after those PRs are combined are faulthandler.enable and register. They need signal-safe multi-thread dumping, and enable additionally needs a safe native C-stack path. Accepting ignored options or calling the allocation-based normal C-stack helper from a signal handler would not implement those APIs correctly.
Validation
- Normal commit hooks and independent read-only review passed.
- Workspace Rust tests passed: 1,543 passed, 20 ignored. Separate C-API tests passed: 149 passed, 2 ignored.
- Strict workspace/all-target and separate C-API Clippy passed with
-D warnings.
- Final SQLite-enabled release build passed. The three changed snippets and the restored time snippet pass on RustPython and CPython 3.15.0/3.15.1. All eight selected pytest cases pass with each CPython version.
- Supported release sendmsg tests (
SendmsgUDPTest, SendmsgTCPTest) passed: 24 tests. The broader socket suite retains the baseline sandbox failures.
- Release
test_sqlite3 test_faulthandler test_time test_inspect: all four files passed, 1,009 tests run, 92 skipped.
- Full
extra_tests with CPython 3.15.1 and the matching debug implementation: 494 passed, 19 failed, 15 subtests passed. All 19 failure IDs reproduce using the main 4242849852 SQLite-enabled binary: restricted multiprocessing/socket/chown operations and existing CPython snippet/test-runner failures. This is not a full-suite pass.
- Final release inventory: 16,227 paths retained, 112 → 110 raw mismatches, exactly the five intended API changes plus the allowed Connection signature, and zero existing exact matches regressed.
Review follow-up (370de1e849): moved the watchdog regression unchanged from stdlib_time.py into stdlib_faulthandler.py. The time snippet now exactly matches main. Workspace/C-API tests and both strict Clippy checks were rerun successfully, and all 19 full-suite failure IDs were freshly reproduced with the main SQLite-enabled binary.
CI follow-up (002c447f4e): CI pins CPython 3.15.0, whose sendmsg metadata still has <unrepresentable> defaults and raises ValueError in inspect.signature. Assert that exact older metadata separately while retaining the existing RustPython/CPython 3.15.1 checks. This is independent of #9758 line wrapping and changes no runtime code. Workspace/C-API tests and both strict Clippy checks were rerun successfully for this follow-up; independent review also passed the signature snippet on all three interpreters. The failure reproduces before the fix and passes afterward with CPython 3.15.0. Full extra_tests with that version: 497 passed, 16 failed, 15 subtests passed; all 16 failures reproduce with the main 4242849852 SQLite-enabled binary.
Hosted CI for 002c447f4e passed, including Linux/macOS/Windows snippets, Rust tests, Clippy, Miri, WASI, and cross-target checks. All 26 reported checks succeeded; the optional base/head/CPython comparison was skipped. The branch remains a draft.
AI assistance
Implementation, comparison with CPython, and validation were assisted by Codex.