[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

Michael Lazar report at bugs.python.org
Thu Jul 16 23:14:50 EDT 2020


Michael Lazar <lazar.michael22 at gmail.com> added the comment:

Greetings,

I just encountered this issue [0] and I agree with the sentiment that the documentation is currently misleading.

Particularly,

> By default, it provides access to the same database as the rest of this module. The initial database is a copy of that provided by the module, and may be extended by loading additional mime.types-style files into the database using the read() or readfp() methods. The mapping dictionaries may also be cleared before loading additional data if the default data is not desired.

“as the rest of the module” implies to me that it should behave the same way as mimetypes.guess_type() does. The documentation only has one other reference to this built-in list of mimetypes, and the default values are hidden behind underscored variable names. I would re-word this as

"By default, it provides access to a database of well-known values defined internally by the python module. Unlike the other mimetypes convenience functions, it does not include definitions from the list of mimetypes.knownfiles. The initial database may be extended by loading additional mime.types-style files into the database using the read() or readfp() methods. The mapping dictionaries may also be cleared before loading additional data if the default data is not desired."

I would be happy to submit a PR if others agree.

[0] https://github.com/michael-lazar/jetforce/issues/38

----------
nosy: +michael-lazar

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38656>
_______________________________________


More information about the Python-bugs-list mailing list