Ensure lower before checking if ext in EXTENSION

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade 2026-01-24 22:48:41 +02:00 committed by GitHub
parent 34814d8d2f
commit c036185514
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -406,10 +406,11 @@ def _import_plugin_for_extension(ext: str | bytes) -> bool:
"""Import only the plugin needed for a specific file extension."""
if isinstance(ext, bytes):
ext = ext.decode()
ext = ext.lower()
if ext in EXTENSION:
return True
plugin = _EXTENSION_PLUGIN.get(ext.lower())
plugin = _EXTENSION_PLUGIN.get(ext)
if plugin is None:
return False