Message 114461 - Python tracker
I think you are closing too aggressively.
Python 3.2a0 (py3k:81783, Jun 6 2010, 16:07:26)
[GCC 4.1.3 20080623 (prerelease) (Ubuntu 4.1.2-23ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mimetypes
>>> mimetypes.guess_extension('text/plain')
'.ksh'
>>>