Source text — English
Translation — Bahasa Indonesia
mimetypes
mimetypes
Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is now :term:`soft deprecated`. (Contributed by Serhiy Storchaka in :gh:`66543`.)
:mod:`!mailcap`: Use the :mod:`mimetypes` module instead.
:mod:`mimetypes`:
:mod:`mimetypes`:
:term:`Soft-deprecate <soft deprecated>` file path arguments to :func:`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. (Contributed by Serhiy Storchaka in :gh:`66543`.)
Valid extensions start with a '.' or are empty for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:`75223`.)