This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mimetypes.guess_extension unable to get non-lowercase mimetype
Type: behavior Stage:
Components: Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Inkhey, iritkatriel
Priority: normal Keywords:

Created on 2020-01-24 09:50 by Inkhey, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg360601 - (view) Author: Guénaël Muller (Inkhey) Date: 2020-01-24 09:50
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.
msg410653 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-15 17:46
See also Issue20392.
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83622
2022-01-15 17:46:52iritkatrielsetnosy: + iritkatriel
messages: + msg410653
2022-01-15 17:34:30iritkatrielsetversions: - Python 3.7, Python 3.8
2020-01-24 23:32:31terry.reedysetversions: - Python 3.6
2020-01-24 09:50:19Inkheycreate