``` python >>> import mimetypes >>> mimetypes.guess_type("README.rst", strict=False) (None, None) ``` In the `python:3.11` Docker image, we get [a vanity type](https://www.iana.org/assignments/media-types/text/prs.fallenstein.rst): ``` python >>> mimetypes.guess_type("README.rst", strict=False) ('text/prs.fallenstein.rst', None) ``` I think most people would expect [`text/x-rst`](https://docutils.sourceforge.io/FAQ.html#what-s-the-official-mime-type-for-restructuredtext-data). Even better would be to get it registered! <!-- gh-linked-prs --> ### Linked PRs * gh-118593 * gh-118599 <!-- /gh-linked-prs -->
Activity
sobolevn commentedon Jan 19, 2023
Related: #17995
jaraco commentedon May 5, 2024
Given that this type is explicit in packaging specifications, it would be valuable for Python to support inferring it from an extension and avoid hacks like these.
sobolevn commentedon May 5, 2024
I am on it :)
pythongh-101137: Add `text/x-rst` and `text/markdown` to `mimetypes`
gh-101137: Add `text/x-rst` to `mimetypes` (#118593)
[3.12] pythongh-101137: Add `text/x-rst` to `mimetypes` (pythonGH-118593
pythongh-101137: Add `text/x-rst` to `mimetypes` (python#118593)
[3.12] gh-101137: Add `text/x-rst` to `mimetypes` (GH-118593) (GH-118599