[issue6626] show Python mimetypes module some love

Jacob Rus report at bugs.python.org
Sun Aug 2 23:52:44 CEST 2009


Jacob Rus <jacobolus at gmail.com> added the comment:

Here is a list I generated of all the current Apache mime.types:

I would just as soon include this in the python standard library, either 
just the Apache file as is, or even these python object literals (maybe 
in a file outside of mimetypes.py), and then *not* import from Apache 
files by default, to cut down on external dependencies. There are 
several alternate MIME types for various types that should be added to 
this list (in earlier positions so they only are used in the type -> 
extension map).

The only issue is that some users may have added to their Apache 
mime.types files for the sake of getting mailman or other python 
programs to do what they want. So I'm not entirely sure to what extent 
we should be 100% backwards compatible in such edge cases. 

My personal opinion is that the 'strict' option is unnecessary and 
should be set to do nothing, because users are more likely to want the 
predictable behavior where an unorthodox type gives back the proper 
extension, than the behavior where their code fails unless they pass a 
flag in: I don't see any reason for a user to want a 'type doesn't 
exist' message back for non-registered types. This isn't a "test for 
IANA registration" module.

----------
Added file: http://bugs.python.org/file14633/apache_mimetypes.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6626>
_______________________________________


More information about the Python-bugs-list mailing list