Skip to content

gh-111637: Clarify MIME type recognition behavior in mimetypes documentation #129546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Doc/library/mimetypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ the information :func:`init` sets up.
The optional *strict* argument is a flag specifying whether the list of known MIME types
is limited to only the official types `registered with IANA
<https://www.iana.org/assignments/media-types/media-types.xhtml>`_.
When *strict* is ``True`` (the default), only the IANA types are supported; when
*strict* is ``False``, some additional non-standard but commonly used MIME types
are also recognized.
However, the behavior of this module also depends on the underlying operating
system. Only file types recognized by the OS or explicitly registered with
Python's internal database can be identified. When *strict* is ``True`` (the
default), only the IANA types are supported; when *strict* is ``False``, some
additional non-standard but commonly used MIME types are also recognized.

.. versionchanged:: 3.8
Added support for *url* being a :term:`path-like object`.
Expand Down
Loading