Kovid Goyal <ko...@kovidgoyal.net> added the comment:

And what about the third issue?

Allow me to elaborate:

mimetypes are a relatively standard set of mappings from well known file 
extensions to MIME descriptors. 

Reading mimetype mappings from the registry, a location that is writable to by 
random programs the user may have installed on his machine, let alone malware, 
is a BAD idea.

It leads to situations like asking for the mimetype of file.jpg and getting 
iage/pjpeg back. Or asking for the mimetype of file.png and getting image/x-png 
back.

If you still consider it good to read mimetypes from the registry, at the very 
least, they should be read before the standard mimetype mappings defined in 
mimetypes.py are applied. That way at least for that set of mappings, users of 
python can be assured of sane query results. 

As it stands now, mimetypes.py is useless and to workaround the problem I 
essentially had to define the mimetype mappings for all the mimetypes my 
program knows about by hand.

----------
resolution: duplicate -> 
status: closed -> open

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

Reply via email to