-
-
Notifications
You must be signed in to change notification settings - Fork 35k
gh-92455: Respect case-sensitive mimetype suffixes #148782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
serhiy-storchaka
merged 20 commits into
python:main
from
yuanx749:fix-mimetypes-case-sensitive-add-type
Jun 15, 2026
Merged
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2720dbd
gh-92455: Respect case-sensitive mimetype suffixes
yuanx749 547a64e
Add NEWS entry
yuanx749 992a6e3
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 561a0aa
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 90b7360
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 268d57c
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 47b2b6b
Add non-strict mimetype case test
yuanx749 fe1096a
Merge branch 'main' into fix-mimetypes-case-sensitive-add-type
yuanx749 e554892
Test strict lookup excludes non-strict types
yuanx749 3085bb9
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 206be36
Test suffix map case lookup
yuanx749 6f639f2
Respect suffix map case lookup
yuanx749 4886f13
Document mimetypes case lookup
yuanx749 046dc95
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 430a329
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 2ed828a
Merge branch 'main' into fix-mimetypes-case-sensitive-add-type
yuanx749 50552fa
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 0874c07
Update documentation
yuanx749 5c56f96
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 44a5da7
Merge remote-tracking branch 'upstream/main' into fix-mimetypes-case-…
yuanx749 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Library/2026-04-20-01-24-22.gh-issue-92455.vXhmad.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Fix :mod:`mimetypes` to prefer case-sensitive matches for MIME type suffixes | ||
| registered with :func:`mimetypes.add_type` before falling back to | ||
| case-insensitive matches. Contributed by Xiao Yuan. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"text/x-r-script" could be added to the database in future. It is better to use something less likely to be added.
Please add also tests for strict=False.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. I changed the test type and added tests for strict=False.