Skip to content
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

Windows 10 Mimetypes for .webp return empty #128703

Open
ewwink opened this issue Jan 10, 2025 · 0 comments
Open

Windows 10 Mimetypes for .webp return empty #128703

ewwink opened this issue Jan 10, 2025 · 0 comments
Labels
OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ewwink
Copy link

ewwink commented Jan 10, 2025

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

@ewwink ewwink added the type-bug An unexpected behavior, bug, or error label Jan 10, 2025
@ewwink ewwink changed the title Windows 10 Mimetypes for .webp return empy Windows 10 Mimetypes for .webp return empty Jan 10, 2025
@ZeroIntensity ZeroIntensity added OS-windows stdlib Python modules in the Lib dir labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants