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.

classification
Title: The MimeTypes class cannot ignore global files per instance
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Sebastian Noack, Wladimir Palant
Priority: normal Keywords:

Created on 2015-06-29 11:11 by Sebastian Noack, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg245930 - (view) Author: Sebastian Noack (Sebastian Noack) Date: 2015-06-29 11:11
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.
History
Date User Action Args
2022-04-11 14:58:18adminsetgithub: 68715
2022-01-20 22:55:09iritkatrielsettype: behavior -> enhancement
versions: + Python 3.11
2015-06-29 12:00:37Wladimir Palantsetnosy: + Wladimir Palant
2015-06-29 11:11:47Sebastian Noackcreate