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

aio-libs / multidict / 34830718957
87%

Build:
DEFAULT BRANCH: master
Ran 14 Sep 2026 09:58AM 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 09:57AM UTC coverage: 86.048% (+0.02%) from 86.024%
34830718957

push

github

web-flow
Stop case-folding istr keys in case-sensitive MultiDict (#1457)

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

## What do these changes do?

`_key_to_identity` in `multidict/_multilib/hashtable.h` returned the
cached lower-cased `canonical` for an `istr` key, so a case-sensitive
`MultiDict` matched that key case-insensitively. The pure Python
`_CSMixin._identity` (`multidict/_multidict_py.py:596`) has no `istr`
branch and returns the key unchanged, so the two backends disagreed.

The C container also contradicted itself:

```pycon
>>> d = MultiDict([(istr("A"), 1)])
>>> list(d.keys())
['A']
>>> "A" in d
False
>>> "a" in d
True
```

Dropping the branch lets `istr` fall through to the existing
`PyUnicode_Check` path at `hashtable.h:141`, which preserves case
exactly as the other two `str` branches in that same function already
do. The case-insensitive sibling `_ci_key_to_identity` is untouched.

## Are there changes in behavior for the user?

Yes. A case-sensitive `MultiDict` no longer folds case for `istr` keys.
That restores the documented contract in `docs/multidict.rst`, added by
#1403 when #1397 was closed: "case-insensitive matching is handled by
:class:`CIMultiDict`, not by ``istr`` equality". `CIMultiDict` is
unaffected.

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

No; it removes three lines and adds two tests to the existing
parametrized suite.

## Related issue number

Related to #1397 and #1403, which state the contract this restores. No
issue to close.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (`docs/multidict.rst` already
states the restored contract; no change needed)
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt`. N/A, no such file in this repo.
- [x] Add a new news fragment into the `CHANGES/` folder
- [ ] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_word... (continued)

715 of 1430 branches covered (50.0%)

Branch coverage included in aggregate %.

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

5212 of 5458 relevant lines covered (95.49%)

1.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 34830718957.1 14 Sep 2026 09:58AM UTC 68
86.05
GitHub Action Run
Source Files on build 34830718957
  • 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 #34830718957
  • 73c1d4ae on github
  • Prev Build on master (#34826710370)
  • Next Build on master (#34842105226)
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