[New-bugs-announce] [issue24527] The MimeTypes class cannot ignore global files per instance

Sebastian Noack report at bugs.python.org
Mon Jun 29 13:11:47 CEST 2015


New submission from Sebastian Noack:

In order to prevent the mimetypes module from considering global files and registry entries, you have to call mimetypes.init([]). However, this will enforce that behavior globally, and only works if the module wasn't initialized yet.

There is also a similar argument in the mimetypes.MimeTypes() constructor, however the list of files passed there are considered additionally. But there is no way to prevent an individual MinmeTypes instance to consider global files.

Adding a "ignore_global_types" option would be trivial too add to the MimeTypes constructor, and would be extremely useful.

----------
components: Library (Lib)
messages: 245930
nosy: Sebastian Noack
priority: normal
severity: normal
status: open
title: The MimeTypes class cannot ignore global files per instance
type: behavior

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


More information about the New-bugs-announce mailing list