Open 7dbc2e6c-091a-47dc-b62e-98b63be23712 opened 4 years ago
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.
See also bpo-20392.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields: ```python assignee = None closed_at = None created_at =
labels = ['type-bug', '3.9']
title = 'mimetypes.guess_extension unable to get non-lowercase mimetype'
updated_at =
user = 'https://github.com/inkhey'
```
bugs.python.org fields:
```python
activity =
actor = 'iritkatriel'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = []
creation =
creator = 'Inkhey'
dependencies = []
files = []
hgrepos = []
issue_num = 39441
keywords = []
message_count = 2.0
messages = ['360601', '410653']
nosy_count = 2.0
nosy_names = ['Inkhey', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39441'
versions = ['Python 3.9']
```