Skip to content

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Feb 10, 2025

@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
'.aifc' : 'audio/x-aiff',
'.aiff' : 'audio/x-aiff',
'.ra' : 'audio/x-pn-realaudio',
'.wav' : 'audio/x-wav',
Copy link
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
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.

Co-authored-by: Petr Viktorin <[email protected]>
Copy link
Member

@encukou encukou left a comment

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
39 checks passed
@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