This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kovid
Recipients brian.curtin, ggenellina, kovid, loewis, ned.deily, ocean-city, pitrou, r.david.murray, tercero12, tim.golden
Date 2010-11-30.18:07:49
SpamBayes Score 4.342813e-08
Marked as misclassified No
Message-id <1291140471.35.0.353656057225.issue10551@psf.upfronthosting.co.za>
In-reply-to
Content
It is, of course, your decision, but IMO, since the mimetypes database in windows appears to be always broken, the default behavior of the mimetypes module in python 2.7 on windows is broken for most (all?) windows installs. For me personally, it doesn't matter anymore, as I have already fixed calibre, but it would be surprising/unexpected behavior for someone new to using mimetypes.py on windows. Certainly, my expectation (perhaps naively) was that guess_type('image.jpg') would always return 'image/jpeg'. 

Users on windows rarely (ever?) modify the registry to change mimetypes. The only thing that does change mimetypes is installed software, without the users' knowledge/consent. So treating the registry as a reliable store of mime information, is not a good idea. 

On unix, the knownfiles are system files. I dont know about OS X, but on linux, since most software is installed by package managers, the package managers usually have policies that prevent application installs from clobbering system files. And of course, running userland applications dont have the necessary privileges to modify the files. 

Out of curiosity, what is the upside of reading mimetypes from the registry, given that it's information cannot be trusted?

And you're most welcome, for calibre :)
History
Date User Action Args
2010-11-30 18:07:51kovidsetrecipients: + kovid, loewis, ggenellina, pitrou, ocean-city, tim.golden, ned.deily, r.david.murray, brian.curtin, tercero12
2010-11-30 18:07:51kovidsetmessageid: <1291140471.35.0.353656057225.issue10551@psf.upfronthosting.co.za>
2010-11-30 18:07:50kovidlinkissue10551 messages
2010-11-30 18:07:49kovidcreate