From b83514362c7ad9e80a9dbf60e4dd1e9649fa0d94 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 24 Jan 2026 23:22:42 +0800 Subject: [PATCH 1/3] Add `image/jxl` to `mimetypes` --- Lib/mimetypes.py | 1 + Lib/test/test_mimetypes.py | 1 + .../next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst | 1 + 3 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 07ac079186fbb7..eb4058fa20cd4a 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -608,6 +608,7 @@ def _default_mime_types(): '.jpeg' : 'image/jpeg', '.jpm' : 'image/jpm', '.jpx' : 'image/jpx', + '.jxl' : 'image/jxl', '.heic' : 'image/heic', '.heif' : 'image/heif', '.png' : 'image/png', diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 0f29640bc1c494..357fe3fcc3aad6 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -270,6 +270,7 @@ def check_extensions(): ("image/jp2", ".jp2"), ("image/jpeg", ".jpg"), ("image/jpm", ".jpm"), + ("image/jxl", ".jxl"), ("image/t38", ".t38"), ("image/tiff", ".tiff"), ("image/tiff-fx", ".tfx"), diff --git a/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst b/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst new file mode 100644 index 00000000000000..be77fb345adae3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst @@ -0,0 +1 @@ +Mime type ``image/jxl`` is now supported by :mod:`mimetypes`. From 93a48f7888e4c14bf322dde6c683255b4e99f44a Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 24 Jan 2026 23:39:25 +0800 Subject: [PATCH 2/3] Update whatsnew --- Doc/whatsnew/3.15.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 8c92ac8e0319da..5e203cc44b35eb 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -603,6 +603,7 @@ math mimetypes --------- +* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.) * Add ``application/node`` MIME type for ``.cjs`` extension. (Contributed by John Franey in :gh:`140937`.) * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) * Rename ``application/x-texinfo`` to ``application/texinfo``. From 1f57565f25951df641783d2e5d5e06c785524c13 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sun, 25 Jan 2026 08:59:25 +0800 Subject: [PATCH 3/3] Sort whatsnew --- Doc/whatsnew/3.15.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 5e203cc44b35eb..5d6878548dfd42 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -603,9 +603,9 @@ math mimetypes --------- -* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.) * Add ``application/node`` MIME type for ``.cjs`` extension. (Contributed by John Franey in :gh:`140937`.) * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) +* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.) * Rename ``application/x-texinfo`` to ``application/texinfo``. (Contributed by Charlie Lin in :gh:`140165`.) * Changed the MIME type for ``.ai`` files to ``application/pdf``.