Skip to content

Windows 10 Mimetypes for .webp return empty #128703

Closed
@ewwink

Description

@ewwink

Bug report

Bug description:

on Windows 10 guess_file_type() checking .webp file return tuple('', None) not tuple('image/webp', None)

The problem is db.read_windows_registry() overwrite default types_map .webp = 'image/webp' into .webp = ''

cpython/Lib/mimetypes.py

Lines 390 to 393 in 65da5db

if files is None or _db is None:
db = MimeTypes()
# Quick return if not supported
db.read_windows_registry()

CPython versions tested on:

3.11, 3.12, 3.13

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesOS-windowsstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions