New submission from Guénaël Muller <in...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue39441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to