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

aio-libs / multidict / 36439719872
87%

Build:
DEFAULT BRANCH: master
Ran 28 Sep 2026 02:56PM UTC
Jobs 1
Files 45
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

28 Sep 2026 02:56PM UTC coverage: 86.992% (+0.003%) from 86.989%
36439719872

push

github

web-flow
Release the pairs del and popall() remove only after the scan (#1627)

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

## What do these changes do?

`del md[key]` and `popall()` decref'd each match as soon as they
unlinked it. A finalizer of a removed key or value could add the key
back mid-scan; the scan then restarted (the restart #1512 added for
concurrent resizes) and removed that new pair too, and `popall()`
returned its value. The removed pairs are now held until every match is
gone: the first in place, which covers the usual single match, any more
in a `reflist_t`. With nothing in the loops able to run Python, the
restart is gone.

The pure-Python `__delitem__()`, `popall()` and `__setitem__()` freed
each match mid-scan as well, and with a finalizer that replaced the
table they raised `IndexError` or miscounted `len()`; they now keep the
removed entries alive until the scan ends. The C `__setitem__()` already
deferred its decrefs.

## Are there changes in behavior for the user?

Yes: pairs a finalizer adds during `del md[key]` or `popall()` stay in
the multidict.

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

No.

## Related issue number

Found by the finalizer audit in #1631.

## 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`

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

New `test_remove_all_keeps_what_a_finalizer_adds` (delitem, popall,
setitem x key/value side x both classes x both backends): against master
6 C and 6 pure-Python delitem/popall cases fail, and the 4 pure-Python
setitem ones.

Tests, one venv and tree copy per leg, full suite: GIL 3.14.7 (2923
passed), FT 3... (continued)

790 of 1580 branches covered (50.0%)

Branch coverage included in aggregate %.

40 of 40 new or added lines in 2 files covered. (100.0%)

8646 of 9267 relevant lines covered (93.3%)

1.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36439719872.1 28 Sep 2026 02:56PM UTC 90
86.99
GitHub Action Run
Source Files on build 36439719872
  • Tree
  • List 45
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36439719872
  • 25b946d6 on github
  • Prev Build on master (#36435697115)
  • Next Build on master (#36466253855)
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