Author terry.reedy
Recipients Michał Szymaniak, SilentGhost, maxking, r.david.murray, terry.reedy
Date 2019-11-08.20:43:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573245812.35.0.334993335666.issue38672@roundup.psfhosted.org>
In-reply-to
Content
An exception report is a failure to finish but not a crash as meant here.

The current code requires all known files and any file explicitly passes to be readable.  The proposed simple change would make it OK if none of them are.  But is this really OK?

Is it really OK if known files are not readable?  Should they not be readable by all?

Removing the isfile call would allow directories to be passed through to db.readfp.  This might not be a good idea.  We would definitely have to think about what errors might be raised on different systems.

I think the try-except should be in init rather than db.read.  The latter can be called directly and I think a user explicitly passing an filename should be notified.  This comment actually also applies to files passed to init.

[Sidenote: the doc says that MimeTypes "provides an interface similar to the one of the mimetypes module."  The mimetypes.db used by mimetypes functions *is* a MimeTypes instance and the user can call db methods anything after init().]

Overall, I am not convinced that the current behavior is a bug, in which case this is an 'enhancement' request that changes the current API.  I am not at all a mimetypes expert, so I nosied a couple of email people who have worked on the module and should know more.
History
Date User Action Args
2019-11-08 20:43:32terry.reedysetrecipients: + terry.reedy, r.david.murray, SilentGhost, maxking, Michał Szymaniak
2019-11-08 20:43:32terry.reedysetmessageid: <1573245812.35.0.334993335666.issue38672@roundup.psfhosted.org>
2019-11-08 20:43:32terry.reedylinkissue38672 messages
2019-11-08 20:43:31terry.reedycreate