https://github.com/python/cpython/commit/253534515c9be908ff4a326f25698e61e8ac59d8
commit: 253534515c9be908ff4a326f25698e61e8ac59d8
branch: main
author: Gil Forcada Codinachs <[email protected]>
committer: hugovk <[email protected]>
date: 2025-10-14T13:20:14+03:00
summary:

gh-139958: Add TOML MIME type (#139959)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
A Misc/NEWS.d/next/Library/2025-10-11-17-41-26.gh-issue-139958.AnCakj.rst
M Lib/mimetypes.py
M Lib/test/test_mimetypes.py

diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index 7d0f4c1fd400d5..6c0efb671975d4 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -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',
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py
index c1806b1c133778..a29815bf49b1e7 100644
--- a/Lib/test/test_mimetypes.py
+++ b/Lib/test/test_mimetypes.py
@@ -230,6 +230,7 @@ def check_extensions():
                 ("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
index 00000000000000..f129f8beb241d7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-10-11-17-41-26.gh-issue-139958.AnCakj.rst
@@ -0,0 +1,2 @@
+The ``application/toml`` mime type is now supported by :mod:`mimetypes`.
+Patch by Gil Forcada.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to