Skip to content

gh-129965: Add missing MIME types#129969

Merged
hugovk merged 12 commits into
python:mainfrom
hugovk:3.14-mimetypes
Feb 21, 2025
Merged

gh-129965: Add missing MIME types#129969
hugovk merged 12 commits into
python:mainfrom
hugovk:3.14-mimetypes

Conversation

@hugovk

@hugovk hugovk commented Feb 10, 2025

Copy link
Copy Markdown
Member

@hugovk
hugovk requested a review from a team as a code owner February 10, 2025 17:29
@bedevere-app bedevere-app Bot mentioned this pull request Feb 10, 2025
@hugovk hugovk added the type-feature A feature request or enhancement label Feb 10, 2025
Comment thread Doc/whatsnew/3.14.rst Outdated
Comment thread Lib/mimetypes.py
'.aifc' : 'audio/x-aiff',
'.aiff' : 'audio/x-aiff',
'.ra' : 'audio/x-pn-realaudio',
'.wav' : 'audio/x-wav',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make mimetypes.MimeTypes().guess_extension('audio/x-wav') no longer work. Is that expected?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can only have a single type per extension with this dict implementation (there's also #122632 that proposes dealing with duplicates; I've not looked closely at it).

If we can only choose one, I think handling for the standards-based type is more useful than an x- extension.

Also mimetypes.MimeTypes().guess_type('filename.wav') now gives the preferred result.

This is also a reason why this kind of change is only made as a feature with no backports. But happy to revert this one if you prefer.

Comment thread Misc/NEWS.d/next/Library/2025-02-10-19-16-48.gh-issue-129965.B6wik0.rst Outdated
Co-authored-by: Petr Viktorin <encukou@gmail.com>

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thank you for the explanation!

@hugovk
hugovk enabled auto-merge (squash) February 21, 2025 15:10
@hugovk
hugovk merged commit 1cf9b6d into python:main Feb 21, 2025
@hugovk
hugovk deleted the 3.14-mimetypes branch February 21, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants