]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-139958: Add TOML MIME type (#139959)
authorGil Forcada Codinachs <gil.gnome@gmail.com>
Tue, 14 Oct 2025 10:20:14 +0000 (12:20 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 10:20:14 +0000 (13:20 +0300)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Lib/mimetypes.py
Lib/test/test_mimetypes.py
Misc/NEWS.d/next/Library/2025-10-11-17-41-26.gh-issue-139958.AnCakj.rst [new file with mode: 0644]

index 7d0f4c1fd400d538a6a80b0af4cdf2da0f6910a9..6c0efb671975d4daa4af80e7105f9edb016ef230 100644 (file)
@@ -500,6 +500,7 @@ def _default_mime_types():
         '.ps'     : 'application/postscript',
         '.ai'     : 'application/postscript',
         '.eps'    : 'application/postscript',
+        '.toml'   : 'application/toml',
         '.trig'   : 'application/trig',
         '.m3u'    : 'application/vnd.apple.mpegurl',
         '.m3u8'   : 'application/vnd.apple.mpegurl',
@@ -587,9 +588,9 @@ def _default_mime_types():
         '.aiff'   : 'audio/x-aiff',
         '.ra'     : 'audio/x-pn-realaudio',
         '.wav'    : 'audio/vnd.wave',
+        '.weba'   : 'audio/webm',
         '.otf'    : 'font/otf',
         '.ttf'    : 'font/ttf',
-        '.weba'   : 'audio/webm',
         '.woff'   : 'font/woff',
         '.woff2'  : 'font/woff2',
         '.avif'   : 'image/avif',
index c1806b1c1337786fdbbbefada073033c57d45caa..a29815bf49b1e7dda81d842664be55ac8bba770e 100644 (file)
@@ -230,6 +230,7 @@ class MimeTypesTestCase(unittest.TestCase):
                 ("application/gzip", ".gz"),
                 ("application/ogg", ".ogx"),
                 ("application/postscript", ".ps"),
+                ("application/toml", ".toml"),
                 ("application/vnd.apple.mpegurl", ".m3u"),
                 ("application/vnd.ms-excel", ".xls"),
                 ("application/vnd.ms-fontobject", ".eot"),
diff --git a/Misc/NEWS.d/next/Library/2025-10-11-17-41-26.gh-issue-139958.AnCakj.rst b/Misc/NEWS.d/next/Library/2025-10-11-17-41-26.gh-issue-139958.AnCakj.rst
new file mode 100644 (file)
index 0000000..f129f8b
--- /dev/null
@@ -0,0 +1,2 @@
+The ``application/toml`` mime type is now supported by :mod:`mimetypes`.
+Patch by Gil Forcada.