From 70969d53a77a8a190c40a30419e772bc874a4f62 Mon Sep 17 00:00:00 2001 From: Antonio <57417288+amaddio@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:10:29 +0100 Subject: gh-97901 add missing text/rtf to mimetypes (GH-97902) Co-authored-by: Noam Cohen --- Lib/mimetypes.py | 1 + Lib/test/test_mimetypes.py | 1 + .../next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst | 1 + 3 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index b33051f..dad3813 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -561,6 +561,7 @@ def _default_mime_types(): '.pl' : 'text/plain', '.srt' : 'text/plain', '.rtx' : 'text/richtext', + '.rtf' : 'text/rtf', '.tsv' : 'text/tab-separated-values', '.vtt' : 'text/vtt', '.py' : 'text/x-python', diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index cc9bae8..30e1c56 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -213,6 +213,7 @@ class MimeTypesTestCase(unittest.TestCase): 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/rtf'), '.rtf') self.assertEqual(mimetypes.guess_extension('video/mpeg'), '.mpeg') self.assertEqual(mimetypes.guess_extension('video/quicktime'), '.mov') diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst b/Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst new file mode 100644 index 0000000..4d2bd65 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst @@ -0,0 +1 @@ +Mime type ``text/rtf`` is now supported by :mod:`mimetypes`. -- cgit v0.12