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

aio-libs / multidict / 35903992859
87%

Build:
DEFAULT BRANCH: master
Ran 23 Sep 2026 06:40PM UTC
Jobs 1
Files 42
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

23 Sep 2026 06:39PM UTC coverage: 87.403%. Remained the same
35903992859

push

github

web-flow
Compute a key's identity outside the critical section (#1538)

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

## What do these changes do?

The single-key methods took `md`'s critical section in `_multidict.c`
and
`capsule.h`, and only then turned the key into its identity and hashed
it.
That work reads the key plus `md->is_ci` and `md->state`, both fixed for
the
object's lifetime, so it never needed the lock; on a free-threaded build
it
can also run Python (a `str` subclass's `lower()`, a finalizer), which
hits a
safepoint and suspends the section anyway.

`md_add()`, `md_del()`, `md_set_default()`, `md_pop_one()`,
`md_replace()`,
`md_get_all()` and `md_pop_all()` now compute the pair first and take
the
section themselves around a `_locked` helper, the shape `md_get_one()`
and
`md_contains()` already use. `md_replace()` stops taking a `reflist_t`
from
its caller; that parameter only existed because the caller owned the
section.
`md_walk()` splits into `md_walk_with_hash()` plus a wrapper so
`getall()` and
`MultiDict_ForEach()` hoist the hash too; the set operators in `views.h`
build
an identity per item inside a walk of their own and keep calling
`md_walk()`.

The pure-Python backend is deliberately untouched. It holds a
`threading.RLock` over whole method bodies for a different reason,
non-atomic
bytecode on every build, and this is internal lock granularity with no
observable behaviour change, so there is nothing for dual-backend
discipline
to mirror.

## Are there changes in behavior for the user?

No.

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

No. It removes a `Py_BEGIN_CRITICAL_SECTION` from ten call sites and
leaves
the write path shaped like the read path.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [ ] Documentation reflects the changes — N/A, no user-visible API
change
- [ ] If you provide code modification, please add yourself to
`CONTRIBU... (continued)

765 of 1530 branches covered (50.0%)

Branch coverage included in aggregate %.

7221 of 7607 relevant lines covered (94.93%)

1.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 35903992859.1 23 Sep 2026 06:40PM UTC 84
87.4
GitHub Action Run
Source Files on build 35903992859
  • Tree
  • List 42
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35903992859
  • 372d632e on github
  • Prev Build on master (#35901661255)
  • Next Build on master (#35906736075)
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