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

aio-libs / multidict / 37144706353
86%

Build:
DEFAULT BRANCH: master
Ran 03 Oct 2026 06:36PM UTC
Jobs 1
Files 49
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

03 Oct 2026 06:34PM UTC coverage: 85.966% (+0.02%) from 85.945%
37144706353

push

github

web-flow
Bump the version on every resize and share the iteration check (#1658)

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

## What do these changes do?

On the GIL build a resize kept `md->version`; only the free-threaded
build bumped it. An `extend()`, `update()` or `merge()` that grew the
table and then failed (a sequence whose `__len__` is large and whose
iteration raises) therefore swapped `md->keys` without changing the
version. `repr()` reads its entries through a pointer taken before the
loop and rechecks only the version, so a key's or value's `__repr__`
doing that made it read freed memory.

`_md_publish_rebuilt()` now bumps the version on both builds, so a new
table always comes with a new version. The "changed during iteration"
check moved into an always-inline `md_check_version(md, version)` in
`dict.h`, used by `md_next()`, `md_prev()`, `to_dict()`, `repr()` and
both walks in `walk.h`; the walks no longer compare `md->keys`.
`repr()`'s message changed from "MultiDict changed during iteration" to
the "MultiDict is changed during iteration" every other check uses.

The pure Python implementation has no table to resize and is unaffected.

## Are there changes in behavior for the user?

Yes: `repr()` raises `RuntimeError` in that case instead of reading
freed memory, and on the GIL build `getversion()` also changes when a
failed bulk update resized the table.

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

No.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (N/A, internal)
- [ ] 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 r... (continued)

791 of 1582 branches covered (50.0%)

Branch coverage included in aggregate %.

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

9224 of 10068 relevant lines covered (91.62%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37144706353.1 03 Oct 2026 06:36PM UTC 98
85.96
GitHub Action Run
Source Files on build 37144706353
  • Tree
  • List 49
  • 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 #37144706353
  • ab37e0e4 on github
  • Prev Build on master (#37118459982)
  • Next Build on master (#37145249750)
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