[issue31040] mimetypes.add_type should complain when you give it an undotted ext

Julien Palard report at bugs.python.org
Fri Sep 13 06:59:42 EDT 2019


Julien Palard <julien+python at palard.fr> added the comment:

I just found a case where the empty mime type is actually usefull, it's in Lib/http/server.py:

    extensions_map = mimetypes.types_map.copy()
    extensions_map.update({
        '': 'application/octet-stream', # Default
        '.py': 'text/plain',
        '.c': 'text/plain',
        '.h': 'text/plain',
        })

It does *not* uses add_type, but demos the fact that the empty type may be usefull from time to time, maybe don't warn and don't deprecate it at all.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31040>
_______________________________________


More information about the Python-bugs-list mailing list