]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-97901 add missing text/rtf to mimetypes (GH-97902)
authorAntonio <57417288+amaddio@users.noreply.github.com>
Tue, 26 Mar 2024 14:10:29 +0000 (15:10 +0100)
committerGitHub <noreply@github.com>
Tue, 26 Mar 2024 14:10:29 +0000 (15:10 +0100)
Co-authored-by: Noam Cohen <noam@noam.me>
Lib/mimetypes.py
Lib/test/test_mimetypes.py
Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst [new file with mode: 0644]

index b33051f533151478f07c2a964e2bf8a3e9e26fa4..dad3813e39dbaeeefec986800c61322682b10ec3 100644 (file)
@@ -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',
index cc9bae893bb55a2bf8a56db31882182a1e0feaf5..30e1c56bf0bc52a52dc18b2aaf0923e9276baf08 100644 (file)
@@ -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 (file)
index 0000000..4d2bd65
--- /dev/null
@@ -0,0 +1 @@
+Mime type ``text/rtf`` is now supported by :mod:`mimetypes`.