https://github.com/python/cpython/commit/b41e008edb4b5c54efedb029c96b16c66446a0d3 commit: b41e008edb4b5c54efedb029c96b16c66446a0d3 branch: 3.12 author: sobolevn <m...@sobolevn.me> committer: ambv <luk...@langa.pl> date: 2025-04-08T12:40:41+02:00 summary:
[3.12] gh-101137: Add `text/x-rst` to `mimetypes` (GH-118593) (GH-118599) files: A Misc/NEWS.d/next/Library/2024-05-05-16-08-03.gh-issue-101137.71ECXu.rst M Lib/mimetypes.py M Lib/test/test_mimetypes.py diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 64b550b069017b..814b3f9c9f9ecc 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -567,6 +567,7 @@ def _default_mime_types(): '.tsv' : 'text/tab-separated-values', '.vtt' : 'text/vtt', '.py' : 'text/x-python', + '.rst' : 'text/x-rst', '.etx' : 'text/x-setext', '.sgm' : 'text/x-sgml', '.sgml' : 'text/x-sgml', diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 90b983aec1b206..c366698b21b460 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -221,6 +221,7 @@ def check_extensions(): self.assertEqual(mimetypes.guess_extension('message/rfc822'), '.eml') self.assertEqual(mimetypes.guess_extension('text/html'), '.html') self.assertEqual(mimetypes.guess_extension('text/plain'), '.txt') + self.assertEqual(mimetypes.guess_extension('text/x-rst'), '.rst') self.assertEqual(mimetypes.guess_extension('video/mpeg'), '.mpeg') self.assertEqual(mimetypes.guess_extension('video/quicktime'), '.mov') diff --git a/Misc/NEWS.d/next/Library/2024-05-05-16-08-03.gh-issue-101137.71ECXu.rst b/Misc/NEWS.d/next/Library/2024-05-05-16-08-03.gh-issue-101137.71ECXu.rst new file mode 100644 index 00000000000000..3df689b2f03866 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-05-05-16-08-03.gh-issue-101137.71ECXu.rst @@ -0,0 +1 @@ +Mime type ``text/x-rst`` is now supported by :mod:`mimetypes`. _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com