[New-bugs-announce] [issue39441] mimetypes.guess_extension unable to get non-lowercase mimetype
Guénaël Muller
report at bugs.python.org
Fri Jan 24 04:50:19 EST 2020
New submission from Guénaël Muller <inkey at inkey-art.net>:
mimetypes.guess_extension and mimetypes.guess_all_extensions doesn't work correctly with non-lowercase mimetype.
>>> import mimetypes
>>> mimetypes.guess_type('file.pptm')
('application/vnd.ms-powerpoint.presentation.macroEnabled.12', None)
>>> mimetypes.guess_extension("application/vnd.ms powerpoint.presentation.macroEnabled.12")
>>>
This issue exist because we automatically convert type as lower in guess_all_extensions, but we do not prevent added type to be lowercase.
----------
messages: 360601
nosy: Inkhey
priority: normal
severity: normal
status: open
title: mimetypes.guess_extension unable to get non-lowercase mimetype
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39441>
_______________________________________
More information about the New-bugs-announce
mailing list