From: Gil Forcada Codinachs Date: Tue, 14 Oct 2025 10:20:14 +0000 (+0200) Subject: gh-139958: Add TOML MIME type (#139959) X-Git-Tag: v3.15.0a1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=253534515c9be908ff4a326f25698e61e8ac59d8;p=thirdparty%2FPython%2Fcpython.git gh-139958: Add TOML MIME type (#139959) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 7d0f4c1fd400..6c0efb671975 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 c1806b1c1337..a29815bf49b1 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -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 index 000000000000..f129f8beb241 --- /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.