From 2a436a69f9c08b1c017e95f2eba1d1c2cd21473d Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 03:48:06 +0100 Subject: [PATCH 01/11] Add dicom support (medical imaging) --- Lib/mimetypes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 07ac079186fbb7..361f924b55da1e 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -477,6 +477,7 @@ def _default_mime_types(): types_map = _types_map_default = { '.js' : 'text/javascript', '.mjs' : 'text/javascript', + '.dcm' : 'application/dicom', '.epub' : 'application/epub+zip', '.gz' : 'application/gzip', '.json' : 'application/json', From 2502c4a2121a1bcc632715bf414330f94553ba74 Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 04:12:36 +0100 Subject: [PATCH 02/11] Add test of dicom --- Lib/test/test_mimetypes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 0f29640bc1c494..32adc59359108f 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -226,6 +226,7 @@ def check_extensions(): for mime_type, ext in ( ("application/epub+zip", ".epub"), ("application/octet-stream", ".bin"), + ("application/dicom", ".dcm"), ("application/gzip", ".gz"), ("application/ogg", ".ogx"), ("application/pdf", ".pdf"), From cdca24c972cc822c0d8a3522de8747be559a3f26 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 03:20:05 +0000 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst new file mode 100644 index 00000000000000..a17bc7237edf0e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst @@ -0,0 +1 @@ +Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. From d1abe74f68ae1ceb7063f98c8bdde207abadf62d Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 03:20:06 +0000 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst new file mode 100644 index 00000000000000..a17bc7237edf0e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst @@ -0,0 +1 @@ +Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. From fae023ba1ac68ab63aa09a68c64119157f58af94 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 03:23:21 +0000 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst new file mode 100644 index 00000000000000..a17bc7237edf0e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst @@ -0,0 +1 @@ +Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. From 2381aa1ce45cb1ea943b0026315334eb6d1f0b4e Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 04:25:28 +0100 Subject: [PATCH 06/11] Add author Information --- .../next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst index a17bc7237edf0e..dbdae915f5a00a 100644 --- a/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst @@ -1 +1 @@ -Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. +Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. This feature was added by Benedikt Johannes. From eb1c369b131dfca7763951f158e02d936f1ab913 Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 04:26:22 +0100 Subject: [PATCH 07/11] Add author information --- .../next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst index a17bc7237edf0e..dbdae915f5a00a 100644 --- a/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst @@ -1 +1 @@ -Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. +Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. This feature was added by Benedikt Johannes. From 19fe88523d59bb763ece24ed4d289b478448d2df Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 13:05:10 +0100 Subject: [PATCH 08/11] Delete Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst --- .../next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst deleted file mode 100644 index a17bc7237edf0e..00000000000000 --- a/Misc/NEWS.d/next/Library/2026-01-25-03-20-03.gh-issue-144217.E1wVXH.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. From 64aace78eaac9d48b31aa48a9cab10c7e21fe125 Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 13:12:21 +0100 Subject: [PATCH 09/11] Delete Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst --- .../next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst deleted file mode 100644 index dbdae915f5a00a..00000000000000 --- a/Misc/NEWS.d/next/Library/2026-01-25-03-20-05.gh-issue-144217.E1wVXH.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. This feature was added by Benedikt Johannes. From ab74c693fbb5a5ffc347a0b6b8b38edd373e43b3 Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 13:27:06 +0100 Subject: [PATCH 10/11] Add to release notes --- 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..facf21fe8c53ca 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -603,6 +603,7 @@ math mimetypes --------- +* Add ``application/dicom`` MIME type for ``.dcm`` extension. (Contributed by Benedikt Johannes in :gh:`144217`.) * 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 f25bbdd6d009d123c62688ddde3ecbc868f7a60d Mon Sep 17 00:00:00 2001 From: benediktjohannes Date: Sun, 25 Jan 2026 16:22:37 +0100 Subject: [PATCH 11/11] Update Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst Co-authored-by: Peter Bierma --- .../next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst index dbdae915f5a00a..d85df59b3749f1 100644 --- a/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst +++ b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst @@ -1 +1 @@ -Added support for DICOM files (for medical imaging) with the official MIME type application/dicom. This feature was added by Benedikt Johannes. +:mod:`mimetypes`: Add support for DICOM files (for medical imaging) with the official MIME type ``application/dicom``. Patch by Benedikt Johannes.