gh-75223: Reject undotted extensions in mimetypes.add_type by OddBloke · Pull Request #2895 · python/cpython (original) (raw)

JulienPalard

@OddBloke

@OddBloke

Extensions that don't start with a dot will never be found by methods/functions that act on the registry, so we should stop users from mistakenly adding them.

The one exception is the empty string extension. This could be in use to detect absent extensions, so instead of raising a ValueError we emit a warning.

JulienPalard

@arhadthedev arhadthedev changed the titlebpo-31040: Reject undotted extensions in mimetypes.add_type gh-75223: Reject undotted extensions in mimetypes.add_type

Apr 15, 2023

@hugovk

hugovk

hugovk previously requested changes Nov 6, 2024

@hugovk

@hugovk

@OddBloke OddBloke mannequin mentioned this pull request

Apr 10, 2022

@hugovk hugovk marked this pull request as draft

January 8, 2025 15:12

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

[ Show hidden characters]({{ revealButtonHref }})