From e4f6445f308109fdeb2c0e668c795fdb1ad335d0 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 20 Oct 2025 09:14:23 -0400 Subject: [PATCH] gh-140166: Use `application/texinfo` as sole MIME type for `.texi` and `.texinfo` files (#140165) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> --- Doc/whatsnew/3.15.rst | 2 ++ Lib/mimetypes.py | 4 ++-- Lib/test/test_mimetypes.py | 2 +- .../Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index b360769b7e50..231ae565192e 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -682,6 +682,8 @@ mimetypes --------- * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) +* Rename ``application/x-texinfo`` to ``application/texinfo``. + (Contributed by Charlie Lin in :gh:`140165`) pathlib diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 6c0efb671975..48a9f430d452 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -500,6 +500,8 @@ def _default_mime_types(): '.ps' : 'application/postscript', '.ai' : 'application/postscript', '.eps' : 'application/postscript', + '.texi' : 'application/texinfo', + '.texinfo': 'application/texinfo', '.toml' : 'application/toml', '.trig' : 'application/trig', '.m3u' : 'application/vnd.apple.mpegurl', @@ -549,8 +551,6 @@ def _default_mime_types(): '.tar' : 'application/x-tar', '.tcl' : 'application/x-tcl', '.tex' : 'application/x-tex', - '.texi' : 'application/x-texinfo', - '.texinfo': 'application/x-texinfo', '.roff' : 'application/x-troff', '.t' : 'application/x-troff', '.tr' : 'application/x-troff', diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index a29815bf49b1..746984ec0ca9 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/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), ("application/vnd.ms-excel", ".xls"), @@ -247,7 +248,6 @@ class MimeTypesTestCase(unittest.TestCase): ("application/x-debian-package", ".deb"), ("application/x-httpd-php", ".php"), ("application/x-rpm", ".rpm"), - ("application/x-texinfo", ".texi"), ("application/x-troff", ".roff"), ("application/xml", ".xsl"), ("application/yaml", ".yaml"), diff --git a/Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst b/Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst new file mode 100644 index 000000000000..c140db9dcd51 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst @@ -0,0 +1 @@ +:mod:`mimetypes`: Per the `IANA assignment `_, update the MIME type for the ``.texi`` and ``.texinfo`` file formats to ``application/texinfo``, instead of ``application/x-texinfo``. -- 2.47.3