From: Antonio <57417288+amaddio@users.noreply.github.com> Date: Tue, 26 Mar 2024 14:10:29 +0000 (+0100) Subject: gh-97901 add missing text/rtf to mimetypes (GH-97902) X-Git-Tag: v3.13.0a6~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70969d53a77a8a190c40a30419e772bc874a4f62;p=thirdparty%2FPython%2Fcpython.git gh-97901 add missing text/rtf to mimetypes (GH-97902) Co-authored-by: Noam Cohen --- diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index b33051f53315..dad3813e39db 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 cc9bae893bb5..30e1c56bf0bc 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 000000000000..4d2bd65ea1fe --- /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`.