[issue1043134] mimetypes.guess_extension('text/plain') == '.ksh' ???

Rafael dos Santos Gonçalves report at bugs.python.org
Sun Nov 21 18:09:20 CET 2010


Rafael dos Santos Gonçalves <rafaelsantosg at gmail.com> added the comment:

ksh is a text/plain to, all this extension are text/plain:
'.ksh', '.pl', '.bat', '.h', '.c', '.txt', '.asc', '.text', '.pot', '.brf'.
The problem is: the code return the first of list:
return extensions[0]
So, I add one boolean parameter in method guess_extension called all_exts. Putting True in this parameter the method returns a tuple with all possible extensions.

I hope helped

----------
keywords: +patch
nosy: +elesbom
Added file: http://bugs.python.org/file19752/issue1043134.patch

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


More information about the Python-bugs-list mailing list