Possible bug with stability of mimetypes.guess_* function output

Peter Otten __peter__ at web.de
Sat Feb 8 09:39:06 CET 2014

Asaf Las wrote:

> On Saturday, February 8, 2014 9:51:48 AM UTC+2, Peter Otten wrote:
>> At least the mimetypes already defined in the module could easily produce
>> the same guessed extension consistently.
> imho one workaround for OP could be to supply own map file in init() thus
> ensure unambiguous mapping across every platform and distribution. guess
> some libraries already doing that. or write wrapper and process
> all_guesses to eliminate ambiguity up to needed requirement.
> that is in case if bug request will be rejected.

You also have to set mimetypes.types_map and mimetypes.common_types to an 
empty dict (or an OrderedDict).

More information about the Python-list mailing list