New submission from Daniel Black <dys...@gmail.com>:

In https://bugs.python.org/issue36460 (which should be probably be disregarded 
until AMP is in RFC) I discovered that the types_map dictionary within the 
mimetypes module is a key: str to key: str (1:1) relationship. The reality is 
that many filename extensions commonly support multiple content-types and even 
sub types. A more useful structure might look like:

(fne is "file name extension" aka foo)

{
  '.fne': ['type1/subtype', 'type2/subtype'],
  '.htm': ['text/html', 'text/css', 'text/javascript'],
  '.html': ['text/html', 'text/css', 'text/javascript']
} 

However this seems to compete with the functionality of the types map so 
another consideration is content-types_map where the content-type is the key 
and the pair values are lists of valid filename extensions:

{
  'audio/x-aiff': ['.aifc', '.aiff', '.au'],
  'text/html': ['.html', '.htm']
}

----------
messages: 339221
nosy: Daniel Black
priority: normal
severity: normal
status: open
title: add filename_extension_map and/or content-types_map dict(s) to mimetypes

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36489>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to