https://github.com/python/cpython/commit/e4f6445f308109fdeb2c0e668c795fdb1ad335d0 commit: e4f6445f308109fdeb2c0e668c795fdb1ad335d0 branch: main author: Charlie Lin <[email protected]> committer: hugovk <[email protected]> date: 2025-10-20T16:14:23+03:00 summary:
gh-140166: Use `application/texinfo` as sole MIME type for `.texi` and `.texinfo` files (#140165) Co-authored-by: Stan Ulbrych <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> files: A Misc/NEWS.d/next/Library/2025-10-15-15-10-34.gh-issue-140166.NtxRez.rst M Doc/whatsnew/3.15.rst M Lib/mimetypes.py M Lib/test/test_mimetypes.py diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index b360769b7e50fb..231ae565192efe 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 6c0efb671975d4..48a9f430d45262 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 a29815bf49b1e7..746984ec0ca9df 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/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), ("application/vnd.ms-excel", ".xls"), @@ -247,7 +248,6 @@ def check_extensions(): ("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 00000000000000..c140db9dcd5150 --- /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 <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``. _______________________________________________ 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]
