]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140166: Use `application/texinfo` as sole MIME type for `.texi` and `.texinfo...
authorCharlie Lin <tuug@gmx.us>
Mon, 20 Oct 2025 13:14:23 +0000 (09:14 -0400)
committerGitHub <noreply@github.com>
Mon, 20 Oct 2025 13:14:23 +0000 (16:14 +0300)
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
Lib/mimetypes.py
Lib/test/test_mimetypes.py
Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst [new file with mode: 0644]

index b360769b7e50fb5f75dc8537ad6f4c4fa3954422..231ae565192efe6cea865529c607381455528423 100644 (file)
@@ -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
index 6c0efb671975d4daa4af80e7105f9edb016ef230..48a9f430d45262d765f7bb739d31ce50187ef545 100644 (file)
@@ -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',
index a29815bf49b1e7dda81d842664be55ac8bba770e..746984ec0ca9dfc58ec593554023027566cf76d9 100644 (file)
@@ -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 (file)
index 0000000..c140db9
--- /dev/null
@@ -0,0 +1 @@
+:mod:`mimetypes`: Per the `IANA assignment <https://www.iana.org/assignments/media-types/application/texinfo>`_, update the MIME type for the ``.texi`` and ``.texinfo`` file formats to ``application/texinfo``, instead of ``application/x-texinfo``.