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

aio-libs / multidict / 34869375795
87%

Build:
DEFAULT BRANCH: master
Ran 14 Sep 2026 04:34PM UTC
Jobs 1
Files 34
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

14 Sep 2026 04:33PM UTC coverage: 86.131% (+0.05%) from 86.08%
34869375795

push

github

web-flow
Fix update() not invalidating iterators when overwriting an existing key (#1458)

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

## What do these changes do?

In the C extension, `update()` (and `merge()`, which shares the same
code path) overwrites an already-present key's value in place without
bumping the hash table's version counter. `__setitem__` bumps it on the
equivalent overwrite, and `update()` already bumps it when a key is
newly added, so a live `keys()`/`items()`/`values()` iterator (or
`iter(md)`) silently kept yielding stale entries instead of raising
`RuntimeError` after an `update()` call that only touched existing
keys. The fix bumps the version once per batch in `md_post_update()`,
matching pure Python's `_post_update()`, which already does this
unconditionally.

## Are there changes in behavior for the user?

Yes. `update()`/`merge()` calls that only overwrite existing keys in
the C extension now correctly invalidate any iterator in progress,
raising `RuntimeError` on the next advance, matching `__setitem__` and
matching the pure-Python implementation's existing behavior.

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

No. The fix is a single version bump in an already-existing,
already-locked cleanup helper; no new public API or code path.

## Related issue number

No linked issue; found via Hypothesis-based fuzz testing of the
iteration guard.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes -- N/A
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt`
- [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>

Tests: `pytest -q` passed (1953 passed, 10 skipped) under both the C
extension and `MULTIDICT_NO_EXTENSIONS=1` pure-Python ... (continued)

727 of 1454 branches covered (50.0%)

Branch coverage included in aggregate %.

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

5322 of 5569 relevant lines covered (95.56%)

1.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 34869375795.1 14 Sep 2026 04:34PM UTC 68
86.13
GitHub Action Run
Source Files on build 34869375795
  • Tree
  • List 34
  • 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 #34869375795
  • 7cd19b08 on github
  • Prev Build on master (#34864619006)
  • Next Build on master (#34872236619)
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