Skip to content

Fix case-insensitive README content type inference - #343

Merged
henryiii merged 2 commits into
pypa:mainfrom
polootyyyyy:fix/readme-extension-case
Oct 21, 2026
Merged

henryiii merged 2 commits into
pypa:mainfrom
polootyyyyy:fix/readme-extension-case

Conversation

@polootyyyyy

Copy link
Copy Markdown
Contributor

README filenames such as README.MD and README.Rst currently raise ConfigurationError, although the pyproject.toml specification requires case-insensitive .md and .rst matching: https://packaging.python.org/en/latest/specifications/pyproject-toml/#readme .

Normalize the content-type comparison while preserving the original filename for file access. Eight regression cases check extension case, the original path, UTF-8 contents, and the emitted description content type and payload.

On unchanged upstream, six cases fail and two lowercase controls pass. With the fix, all 414 tests pass on Linux arm64 with Python 3.12. Ruff and formatting checks pass. Full-project mypy diagnostics are unchanged (one existing comparison-overlap error); focused checking of the changed files passes.

@henryiii
henryiii force-pushed the fix/readme-extension-case branch from 6eed5ea to 0d6b5b8 Compare October 21, 2026 14:11
@henryiii
henryiii merged commit c518c8e into pypa:main Oct 21, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants