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

aio-libs / multidict / 33975467489
87%

Build:
DEFAULT BRANCH: master
Ran 05 Sep 2026 03:40PM UTC
Jobs 1
Files 31
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

05 Sep 2026 03:39PM UTC coverage: 85.368% (+0.05%) from 85.314%
33975467489

push

github

web-flow
Do not swallow non-TypeError exceptions in feature-detection fallbacks (#1382)

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

## What do these changes do?

Several feature-detection fallbacks cleared *every* pending exception
when a fallback path was taken:
view richcompare and items-view `__contains__` measuring `len(other)`,
items-view `__contains__`
computing the identity, `MultiDict.__eq__` probing `keys()`, and
`extend()`/constructor probing
`items()`. A `MemoryError` or `KeyboardInterrupt` raised by the user
object was silently discarded. Each
is now guarded with `PyErr_ExceptionMatches()` so only the expected
`TypeError`/`AttributeError` is
cleared and anything else propagates — the same pattern the sibling
sites in `views.h` already use.
C-extension-only; the pure-Python backend propagates naturally.

## Are there changes in behavior for the user?

Yes (edge case): an exception other than `TypeError`/`AttributeError`
(notably `MemoryError`,
`KeyboardInterrupt`) raised by an object being probed now propagates
instead of being swallowed. The
normal fallbacks (a non-sized or non-mapping object) are unchanged.

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

No. It applies the module's existing guard pattern to the few sites that
missed it.

## Related issue number

Findings from the C-extension analysis report #1306.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
(`test_non_typeerror_exceptions_are_not_swallowed`)
- [x] Documentation reflects the changes (no public API change)
- [ ] N/A — no `CONTRIBUTORS.txt` in this repo
- [x] Add a new news fragment into the `CHANGES/` folder

---------

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

627 of 1254 branches covered (50.0%)

Branch coverage included in aggregate %.

20 of 20 new or added lines in 1 file covered. (100.0%)

4052 of 4227 relevant lines covered (95.86%)

1.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 33975467489.1 05 Sep 2026 03:40PM UTC 62
85.37
GitHub Action Run
Source Files on build 33975467489
  • Tree
  • List 31
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #33975467489
  • 0b5beca8 on github
  • Prev Build on master (#33972388218)
  • Next Build on master (#33988650647)
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