• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / multidict / 36150297821
87%

Build:
DEFAULT BRANCH: master
Ran 25 Sep 2026 02:52PM UTC
Jobs 1
Files 43
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Sep 2026 02:51PM UTC coverage: 87.004% (-0.05%) from 87.058%
36150297821

push

github

web-flow
Name the event and multidict when a watcher callback fails (#1585)

<!-- Thank you for your contribution! -->

## What do these changes do?

A failing watcher callback is now reported the way CPython's
`_PyDict_SendEvent()` reports a failing dict watcher. The message names
the event and the multidict's type and address, for example `Exception
ignored in MultiDict_EVENT_ADDED watcher callback for
<multidict._multidict.MultiDict object at 0x...>`, and the multidict
itself is no longer passed to `sys.unraisablehook`. Previously every
event except DEALLOCATED passed the multidict, so the default hook would
`repr()` it and could run arbitrary code (a subclass `__repr__`) while
an error was being reported.

On 3.13+ this uses `PyErr_FormatUnraisable()`. On 3.10 to 3.12, which
lack it, it uses `_PyErr_WriteUnraisableMsg()`, and the address is
formatted with `PRIxPTR` because MSVC's `%p` omits the `0x`. This only
affects the C extension: watchers have no pure-Python counterpart.

## Are there changes in behavior for the user?

Yes, for C API clients whose watcher callbacks fail:
`sys.unraisablehook` now receives `object=None` and a descriptive
`err_msg`.

## Is it a substantial burden for the maintainers to support this?

No. It is one cold function with a version branch.

## Related issue number

Follow-up to #1551.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` (N/A)
- [x] Add a new news fragment into the `CHANGES/` folder
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`

Drafted with Claude Code (Claude Opus 5.5); to be reviewed by @asvetlov.

<details>
<summary>Agent run details (optional, for reviewers)</summary>

Each leg ran in its own venv and tree copy.

- GIL 3.14.7: 2734 passed
- Free-threaded 3.14.7t, `MULTIDICT_DEBUG_BUILD=1`, ... (continued)

780 of 1560 branches covered (50.0%)

Branch coverage included in aggregate %.

19 of 28 new or added lines in 1 file covered. (67.86%)

8104 of 8651 relevant lines covered (93.68%)

1.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
74.41
-0.24% tests/test_capi.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36150297821.1 25 Sep 2026 02:52PM UTC 86
87.0
GitHub Action Run
Source Files on build 36150297821
  • Tree
  • List 43
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36150297821
  • 59488eaa on github
  • Prev Build on master (#36149088889)
  • Next Build on master (#36150606046)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc