Skip to content

INT-ERROR-01: Expand Python exception semantics #124

Open

Description

@ellainng

Scope

  • Adopt exception subclasses, raise-from, cause/context/suppression metadata and bare reraises; preserve original source tracebacks.
  • Adopt ExceptionGroup/BaseExceptionGroup and except* splitting/merging only after a reference matrix, including finally interactions and resource interruption.

Evidence and limits

Pinned CPython 3.14.7 is the semantic oracle. Run independently compiled Python source in Node and Chromium; record supported signatures, explicit refusals and zero logical teardown. Core-source and classes-source admission remain explicit. Library/package coverage, browser capabilities and native ABI support are separate claims. No publication or deployment is included.

Dependencies and readiness

Readiness: Ready. The function-binding (#118) and finite O1–O96 foundation (#123) prerequisites are accepted. Define exact reference-backed implementation slices before widening source admission; focused stacked PRs may progress under language Track A (#600).

Tracked by the versioned broad-compatibility inventory in #99. The parent class milestone #33 and async milestone #34 remain open.

Ordinary-syntax value messages

LA-8 accepts arbitrary assertion message identity and lazy exception construction without invoking formatting callbacks. The cases in ordinary-syntax.json and exceptions.json now record that adopted behavior. Unadopted message display families remain under #127.

Ordinary exception batches accepted — 2026-10-31

Two focused batches (three PRs followed by four) are accepted through squash merges #626–#630, #632 and #633.

The pinned CPython 3.14.7 corpus records 123 observations: 115 semantic/error comparisons and eight explicit refusals, with 24 cases shared by core-source/1. Both Node and Chromium pass drain, step and parked execution. The final 16-job regression run passes, alongside 518 focused exception/iteration/container/generator/execution tests, nine runner tests, 17 installed-wheel offline checks, and the 140-site source-refusal audit. Accounting revision 19 records the intended single-string identity change; the eight resulting execution observations remain stable through the remaining slices.

Final main is dd0613d, clean and synchronized, with wheel/installed-CLI/interpreter-startup smokes and the final-main CI smoke passing. Completed task branches are removed and the unrelated code-cells stash is preserved.

Remaining #124 work is exception groups/except* splitting/merging, general handler expressions/named tuple values, traceback objects/mutation, notes, and structured native exception constructors/fields/subclasses. User-class generator throw remains #120; multiple-argument/container/default native exception display families remain #127. The exact profile and runnable example are documented in the ordinary exception contract.

This accepts the named ordinary exception slices. #124 remains In Progress/Ready until its remaining exact contracts are accepted; #123 is complete and the parent language/application/candidate milestones retain their own gates.

Handler expressions and notes accepted — 2026-11-01

Four focused squash merges #637, #638, #639 and #641 complete this batch:

The pinned CPython 3.14.7 exception corpus has 174 cases: 167 semantic/error comparisons and seven explicit refusals, with 39 cases explicitly shared by core-source/1. All six Node and six Chromium drivers pass. The general source corpus preserves its 408-case denominator and passes 378 supported comparisons plus 30 explicit refusals on both targets. These are finite corpus results, not an overall Python-completion percentage.

Exact API additions include BaseException.add_note(note, /) and inherited bound/unbound calls, lazy notes dictionary storage, replacement/deletion, string/list subtype identity, native append behavior and owned getter/setter/fallback failures. Handler calls, attributes, subscripts and tuple values evaluate lazily through verified modern-bytecode expression blocks. Classes-source/1 owns note callbacks; the shared core cases remain explicit. Logical teardown, cancellation and shared work/allocation budgets pass, including cyclic notes and suspended handler selection. Host summaries retain their copied diagnostic contract without executing note getters or formatting arbitrary manually stored notes.

All 16 corrected batch regression jobs pass. Local evidence includes 227 focused exception/source/lifecycle/verifier tests, nine runner tests, 26 isolated installed-wheel offline checks and the 138-site source-refusal audit. Accounting revision 20 records the intended handler-expression instructions/pool/validation costs in three composed cases and retains revision 19 counters; the note/acceptance slices preserve all eight resulting resource observations.

Final main is de363e3, clean and synchronized, with wheel/installed-CLI/interpreter-startup smokes and final-main CI passing. Each dependent retained its reviewed contents and focused diff during parent-squash reconciliation. The four task issues are closed and their Project items are Done; completed branches are removed and the unrelated code-cells stash is preserved.

Remaining #124 work includes exception groups/except* splitting/merging, traceback objects/mutation and note rendering/export, and structured native exception constructors/fields/subclasses. User-class generator throw remains #120; remaining representations/formatting remain #127. The exact exception contract and runnable example document the accepted profile.

A2 remains open. Package qualification, broader source/builtin/async reconciliation, standard-library coverage and candidate/release gates retain their separate evidence requirements. Certified package workloads and publication/deployment status are unchanged by this batch.

Native exception batches accepted — 2026-11-01

Two further Track A batches are accepted through eight focused, dependency-ordered squash merges.

Batch 1:

Batch 2:

All 16 final regression jobs pass. The automated CPython 3.14.7 exception corpus records 310 cases: 301 semantic/error comparisons and nine explicit refusals; 53 cases are explicitly shared with core-source/1. Node and Chromium pass every drain, step and parked driver. Two separately recorded macOS arm64 pinned-reference crash probes remain qualified divergences, outside successful differential counts; Node and installed offline Chromium check safe None behavior. These are finite corpus/API observations, not an overall Python-completion percentage.

Local acceptance includes 395 exception/source/lifecycle/qualification tests, nine runner tests, 53 isolated installed-wheel offline checks, the 139-site refusal audit and all eight unchanged deterministic execution resource observations. The isolated browser compatibility inventory passes 756 observations (717 supported, 35 deferred and four host-restricted), with its own denominator. Browser conformance retains its commands/matrix and now uses the existing 15-minute integration bound after two 12-minute cancellations interrupted the final compatibility command. Passing reviewed-content CI was retained through parent-squash reconciliation; duplicate ancestry-only runs were cancelled.

Final main is bd8b212, clean and synchronized, with local wheel/isolated installed-CLI/interpreter-startup smokes and final-main CI passing. All eight task issues are closed and Project items are Done; completed branches are removed and the unrelated code-cells stash is preserved. The exact API contract and native exception example record the accepted profile.

A2 and #124 remain open for groups/except*, traceback objects/mutation and note rendering/export, automatic attribute/import failure enrichment, and remaining structured native families including SyntaxError/Unicode. User-class generator throw and the two delegated NULL-payload qualifications remain #120; remaining representations/formatting remain #127. Package/library qualification, the broader language/async inventory and candidate #36 retain separate evidence gates. Certified package workloads and publication/deployment status are unchanged by these batches.

Runtime metadata and syntax exception batches accepted — 2026-11-01

Two further Track A batches are accepted through eight focused, dependency-ordered squash merges.

Batch 1:

Batch 2:

All 16 final regression jobs pass. The pinned CPython 3.14.7 exception corpus records 438 cases: 430 semantic/error comparisons and eight explicit refusals, with 76 explicitly shared core-source/1 cases. All six Node and six Chromium drain/step/parked drivers pass. Four qualifications remain outside successful differential counts: two existing macOS arm64 pinned-reference delegated-return crash probes and two SyntaxError host differences. Native location rendering uses POSIX separators and signed 64-bit C long behavior on every interpreter host; the separate Windows expectations are derived from pinned implementation/configuration and do not certify Windows-native parity.

Final local evidence includes 582 focused function/exception/execution tests, 71 isolated installed-wheel offline checks and the 139-site source-refusal audit. Accounting revision 22 records the owned module-origin storage edge and associated work/bytes; all eight resulting deterministic execution resource observations remain stable through the syntax slices and final legacy follow-up. Passing reviewed-content CI was retained through parent-squash reconciliation; duplicate ancestry-only runs were cancelled.

Final main is 8533231, clean and synchronized, with wheel/isolated installed-CLI/interpreter-startup smokes and final-main CI passing. All eight task issues are closed and Project items are Done; completed branches are removed and the unrelated code-cells stash is preserved. The exact API contract, runtime metadata example and syntax exception example record the accepted profile.

A2 and #124 remain open for groups/except*, traceback objects/mutation, note rendering/export, write/delete attribute metadata, custom import provenance, parser-generated syntax fields, Unicode structured families and the declared host qualifications. User-class generator throw and the two delegated crash qualifications remain #120; broader displays/formatting remain #127. Package/library qualification, broader language/async reconciliation and candidate #36 keep their separate evidence gates. Certified package workloads and publication/deployment status are unchanged by these batches.

Unicode translation exception batch accepted — 2026-11-01

Three focused, dependency-ordered squash merges complete this finite #124 batch under Track A #600:

All 16 final regression jobs pass. The pinned CPython 3.14.7 exception corpus now records 543 cases: 535 semantic/error comparisons and eight explicit refusals, with 109 cases explicitly shared by core-source/1. Node and Chromium pass every drain, step and parked driver. Four existing host/crash qualifications remain outside successful differential counts. These are finite corpus/API observations, not an overall Python-completion percentage.

Local evidence includes 750 focused exception/function/operation/execution checks, nine runner tests, 83 isolated installed-wheel offline checks and the 139-site scope audit. All eight deterministic execution observations retain accounting revision 22. Parent-squash conflicts preserved the reviewed implementation and focused diffs; affected composition/translation checks and asset/scope audits passed after resolution. Passing implementation CI was retained through ancestry reconciliation.

Final main is d0b4462, clean and synchronized, with local wheel/isolated CLI/interpreter startup smokes and final-main CI passing. All three task issues are closed and Project items are Done; completed branches are removed and the unrelated code-cells stash is preserved. The exact exception contract and record translation example record the accepted surface.

A2 and #124 remain open for groups/except*, traceback objects/mutation, note rendering/export, remaining attribute/import/parser metadata, Unicode Encode/Decode structured families and the declared qualifications. User-class generator throw remains #120; broader representations/formatting remain #127. Package/library qualification and candidate #36 retain their separate evidence gates.

Unicode encoding and decoding batches accepted — 2026-11-01

Two focused Track A batches are accepted through dependency-ordered squash merges.

Batch 1:

Batch 2:

All 16 jobs in the final reviewed-content regression run pass. The pinned CPython 3.14.7 exception corpus has 728 cases: 718 semantic/error comparisons and ten explicit refusals, including 173 explicitly shared core-source/1 cases. Node and Chromium pass every drain, step and parked profile/driver combination. Four existing host/crash qualifications remain outside these successful differential counts. These finite corpus/API observations do not measure overall Python completion.

Local validation includes 1,002 exception/function/operation/execution checks, nine runner tests, 106 isolated installed-wheel offline Chromium checks, the 139-site source inventory audit and asset/distribution/installed-CLI checks. All eight deterministic execution resource cases retain accounting revision 22. Passing unchanged-content CI was retained across squash reconciliation; only the two interrupted rendering jobs were retried, and redundant ancestry-only runs were cancelled. LA-36A restores the reviewed inventory without runtime changes; its committed scope/asset audits and retained full LA-36/LA-37 evidence cover the manifest-only correction.

Final main is 1153c0e, clean and synchronized, with final-main CI smoke passing. All seven task issues are closed and their Project items are Done; completed branches are removed and the unrelated code-cells stash is preserved. The exact exception contract, encoding example and decoding example record the adopted surface.

A2 and #124 remain open for groups/except*, traceback objects/mutation, note rendering/export, remaining attribute/import/parser metadata and automatic codec metadata, plus the declared qualifications. The latter has two named field-read boundaries in the corpus. User-class generator throw remains #120; general representations/formatting remain #127. Package/library qualification and candidate #36 retain their separate evidence gates. No publication or deployment occurred.

Runtime codec metadata accepted — LA-38–LA-43

Six focused PRs #700–#705 are squash-merged and child tasks #694–#699 are closed. Strict ASCII/Latin-1/UTF-8 encoding and ASCII/UTF-8 decoding now expose native fields and arguments, original encoding input identity, immutable decoder snapshots and exact failure ranges/reasons, with composed/offline acceptance. Track A #600 records complete receipts: all 16 regression jobs, 852 pinned-reference cases (844 supported/eight refused), 267 shared core cases, five separately recorded qualifications and 128 installed offline checks. Final main f3cbb47 and its CI smoke pass. The one-byte decoder bytes-cache identity qualification remains #117; groups/except*, traceback objects/mutation, note export and remaining attribute/import/parser metadata keep this issue and A2 open.

Generic attribute mutation batch accepted — 2026-11-01

Five focused, dependency-ordered squash merges complete this finite Track A batch:

All 16 jobs in the corrected regression run pass. The pinned CPython 3.14.7 exception corpus records 940 scored cases: 929 supported semantic/error comparisons and 11 explicit refusals, with 267 cases explicitly shared by core-source/1. Every Node and Chromium drain/step/parked driver/profile combination passes. Six host/crash/cache qualifications remain outside successful differential counts. These finite corpus/API observations do not measure overall Python completion.

The exact additions cover name/obj selection for dictionary-free generic writes/deletions, read-only non-data attributes, empty slots, string-subtype names and explicitly replaced/reset instance dictionaries. Native object/type/module/method/super attribute wrappers validate native string content while preserving owned keys where adopted. Callback KeyError subclasses follow native mutation conversion; other owned hook/descriptor errors preserve their identities. Original-instance exact-string deletion fields retain two named shared-key/inline-storage refusals, and type-namespace subtype-key publication retains its hash gate. Other native/module/class mutation layouts remain separately qualified.

The additional crash qualification retains dictionary replacement from inside a key-comparison callback: 3 of 16 isolated pinned macOS arm64 probes exited with SIGSEGV (-11). Two Linux CI corpus invocations also crashed before case-identifying diagnostics existed. The input continues to pass safe interpreter and installed offline checks; automated reference runs exclude it. Failed reference processes now identify the fixture and exit code or timeout without suppressing the original failure.

Local acceptance includes the complete 940-case Node parked matrix, all newly adopted Chromium parked cases, 142 isolated installed-wheel offline checks, focused ownership/interruption/budget and original-frame checks, 11 diagnostic/runner checks and the 139-site scope audit. All eight deterministic execution resource observations retain accounting revision 22. Affected reconciliation checks and asset/scope audits pass; focused diffs and reviewed contents were retained without rewriting shared history. Passing corrected descendant CI supplies the batch evidence.

Final main is 06be41d, clean and synchronized, with local wheel/isolated installed-CLI/interpreter-startup smokes and final-main CI passing. All five task issues are closed and Project items are Done; completed branches are removed after immediate-dependent reconciliation. The exception contract and record mutation example record the accepted profile.

A2 and #124 remain open for groups/except*, traceback objects/mutation, note rendering/export, original-instance deletion fields, remaining native/module/class attribute/import/parser metadata and the declared qualifications. General formatting remains #127; generator throw and broader codec/bytes identity retain #120/#117. No new library or package workload is certified. Broader language/async/library reconciliation and candidate/release gates retain their separate evidence requirements. No publication or deployment occurred.

Module/class and callable/view mutation batches accepted — LA-47–LA-52

Six focused PRs #722, #723, #724, #725, #726 and #727 are squash-merged; tasks #716–#721 are closed and Done. Selective mutation name/obj fields now cover the adopted module, heap-class, source/native callable, namespace-proxy and dictionary-view paths, including native wrappers/descriptors, subtype names, KeyError conversion and retained owner cycles.

Track A #600 records complete receipts: all 16 regression jobs, 1,222 scored CPython 3.14.7 cases (1,211 supported/11 refused), 267 shared core cases, six separate qualifications, 1,661 local exception/class/execution checks and 164 installed offline checks. All eight revision-22 resource observations and the 139-site source audit pass. Final main c04de41 and its CI smoke pass; completed branches are removed and the unrelated stash is preserved.

Groups/except*, traceback objects/mutation, note export, original-instance shared-key deletion, type subtype-key publication, remaining native attribute/import/parser metadata and the existing qualifications keep this issue and A2 open. Other representation/container/library/package/candidate gates retain their owners.

Value, generator and iterator mutation batches accepted — 2026-11-01

Two focused Track A batches are accepted through nine dependency-ordered squash merges.

Batch 1:

Batch 2:

The complete corrected regression run passes all 16 jobs. The pinned CPython 3.14.7 exception corpus adds 519 scored cases and now records 1,741: 1,730 supported semantic/error comparisons and 11 explicit refusals, with 267 explicitly shared core-source/1 cases. Every Node/Chromium drain, step and parked profile combination passes. Six existing host/crash/cache qualifications remain outside those counts. These finite observations do not measure overall Python completion.

The exact additions cover selective name/obj fields for missing versus read-only scalar/container/buffer attributes, direct storage descriptors, generator state/name mutation and adopted native iterator layouts. Original receiver/string-subtype key identity survives args replacement; generator names retain string subtypes. Native object wrappers and direct source syntax agree. Subtype dictionaries, owned hooks and existing core admission remain explicit.

Local acceptance includes 2,167 exception/class/execution checks, all 1,741 Node parked cases, every newly adopted Chromium parked case, 192 isolated installed-wheel offline checks, the complete 44-check browser shard locally in 485.824 seconds, and the 139-site source audit. The eight deterministic execution resource observations remain unchanged. Affected source/ownership, diagnostic/runner, script and asset/scope checks pass after parent-squash reconciliation; unchanged passing evidence was retained without rewriting shared history.

Two fixed-30-second Linux differential subprocess timeouts led to the bounded case-count deadline in LA-58A. Two 15-minute browser-job cancellations reached the final compatibility command after preceding checks passed; LA-58B retains all commands/shards with a finite 20-minute conformance limit and the existing 15-minute integration limit. The corrected complete workflow passes.

Final main is b6d280c, clean and synchronized, with local wheel/isolated installed-CLI/interpreter-startup checks and final-main CI smoke passing. All nine task issues are closed and Project items are Done. Completed branches are removed after immediate-dependent reconciliation; the unrelated code-cells stash is preserved. The exception contract, value failure example and iterator failure example record the accepted surface.

A2 and #124 remain open for frame/code/cell/property/super mutation layouts, direct scalar storage descriptors, original-instance shared-key deletion, other native/import/parser metadata, groups/except*, traceback objects/mutation and note export. Wider formatting, container/iterator/codec APIs, user-class generator throw, library/package qualification and candidate/release gates retain their existing owners.

Reflective mutation milestone accepted — 2026-11-02

One complete milestone was implemented and validated locally, then pushed as a single feature commit and squash merged. All 678 shared local PR-check IDs pass, including all 388 Node checks, all 274 Chromium conformance checks and nine browser integrations. The final exception unit run passes 2,257 tests; isolated installed-wheel offline acceptance passes 215 checks, including original dynamic diagnostics, retained owner cycles, Stop/Restart and reduced-profile updates. The global source audit records 140 owned refusal sites. All eight deterministic execution resource observations retain revision 22. Failed local browser module-loading attempts were retried in one runner, with one residual check isolated to one worker; other successful evidence was retained.

The pinned CPython 3.14.7 exception corpus now records 1,828 cases: 1,808 supported semantic/error comparisons and 20 explicit refusals, with 267 explicitly shared core-source/1 cases. Every Node/Chromium drain, step and parked profile combination passes. Six existing host/crash/cache qualifications remain outside successful differential counts. These are finite corpus/API observations, not an overall Python-completion percentage.

Missing frame/code/cell/frame-locals-proxy/property/super attributes preserve the original receiver and reflected string-subtype key independently of args. Read-only attributes and direct int/float/complex storage descriptors leave native name/obj fields absent; writable cell/property fields and numeric subclass dictionaries retain their behavior. Custom key hash/equality on the reflective layouts and frame tracing/jumping retain explicit refusals. The exact contract and runnable example are in docs/interpreter-exceptions.md and examples/interpreter_reflective_failures.py.

Final main is 56e19c1, clean and synchronized, with main smoke passing. Merge reused the complete local validation; the automatically triggered duplicate PR workflow was cancelled. #756 is complete and its Project item is Done. A2/#124 remain open for #757, original-instance shared-key deletion, other native/import/parser metadata, groups/except*, traceback objects/mutation and note export. Broader formatting, container/iterator/codec APIs, library/package certification and candidate/release gates retain their separate owners; no package workloads gain certification from this milestone.

Native attribute key milestone accepted — LA-62

One locally completed milestone was published as a single feature commit and squash merged. Track A #600 records the complete receipts: all 678 shared local PR-check IDs, 223 isolated installed-wheel offline checks, all Node/Chromium drain/step/parked profiles, 2,443 scored exception cases (2,387 supported/56 refused), 267 shared core cases and seven separate qualifications. Four startup-only browser interruptions passed isolated one-worker retries; other passing evidence was retained and duplicate PR CI was cancelled.

Native mutation now preserves key hash/equality/truth order, actual descriptor selection and aliases, suppressed lookup errors, independent dictionary hashing, writable fields, original key/receiver/type ownership and source hooks. Function-name subtype values and native read-only descriptor fields are reconciled. Collection/interruption/shared limits, dynamic diagnostics and offline Stop/Restart pass; all eight revision-22 resource observations and the 140-site source audit remain stable.

Final main is 5072ae1, clean and synchronized, with its automatic smoke passing. Merged feature branches are removed. #757 is closed and Done; #759, original-instance shared-key deletion, remaining native/import/parser metadata, groups/except*, traceback objects/mutation and note export keep this issue and A2 open. Wider formatting, library/package certification and candidate/release gates retain their separate owners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions