summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio <57417288+amaddio@users.noreply.github.com>2024-03-26 14:10:29 (GMT)
committerGitHub <noreply@github.com>2024-03-26 14:10:29 (GMT)
commit70969d53a77a8a190c40a30419e772bc874a4f62 (patch)
tree97fce65ff869dfbc9cee0ea365d1afa24a2655d5
parent4ec347760f98b156c6a2d42ca397af6b0b6ecc50 (diff)
downloadcpython-70969d53a77a8a190c40a30419e772bc874a4f62.zip
cpython-70969d53a77a8a190c40a30419e772bc874a4f62.tar.gz
cpython-70969d53a77a8a190c40a30419e772bc874a4f62.tar.bz2
gh-97901 add missing text/rtf to mimetypes (GH-97902)
Co-authored-by: Noam Cohen <noam@noam.me>
-rw-r--r--Lib/mimetypes.py1
-rw-r--r--Lib/test/test_mimetypes.py1
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2022-10-05-09-33-48.gh-issue-97901.BOLluU.rst1
3 files changed, 3 insertions, 0 deletions
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`.