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

Florian Bruhin report at bugs.python.org
Mon Nov 18 08:34:34 EST 2019


Florian Bruhin <python.org at the-compiler.org> added the comment:

Ah, I only saw dhess' comment after already submitting mine.

> By historical design, instantiating a MimeTypes class instance directly will not use host OS system mime type files.

Yet that wasn't what happened before that commit, and it's also not the behaviour which was (and is) documented - from https://docs.python.org/3.6/library/mimetypes.html#mimetypes.MimeTypes

    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.

    The optional filenames parameter can be used to cause additional files to be loaded “on top” of the default database.

You might be right in that the new behaviour is in some way more correct - but it's wildly backwards-incompatible, and it's contrary to everything the documentation says.

I've only skimmed over bpo-4963 though - maybe I missing something?

----------

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


More information about the Python-bugs-list mailing list