Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#73242 - [python] make mailcap an optional dependency for python

Attached to Project: Arch Linux
Opened by Csaba Henk (csheemea) - Monday, 03 January 2022, 15:45 GMT
Last edited by Antonio Rojas (arojas) - Monday, 03 January 2022, 20:41 GMT
Task Type Bug Report
Category Packages: Core
Status Assigned
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



For python mimetypes module relies on the /etc/mime.types file, provided by mailcap (or actual mime-types provider).

The dependency is implicit: mimetypes does not present an error condition on lack of /etc/mime.types, rather provides a stub. However, this results in unreliable deployment for a program that utilizes the mimetypes module. While this is basically a flaw of the Python ecosystem, Arch can mitigate the issue by adding the optional dependency.

Additional info:
* package version(s): seen with python 3.10.1-2

Steps to reproduce:

$ pacman -Q mailcap
error: package 'mailcap' was not found
$ python -c 'import sys,mimetypes; print(mimetypes.guess_type(sys.argv[1]))' foo.mkv
(None, None)
$ pacman -Q mailcap
mailcap 2.1.53-1
$ python -c 'import sys,mimetypes; print(mimetypes.guess_type(sys.argv[1]))' foo.mkv
('video/x-matroska', None)
This task depends upon