https://github.com/python/cpython/commit/76d3ae71bab2f6391193610f4aedf8337be4112a
commit: 76d3ae71bab2f6391193610f4aedf8337be4112a
branch: main
author: benediktjohannes <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-01-25T22:22:43Z
summary:

gh-144217: Add dicom support (medical imaging) to mimetypes (GH-144218)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.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 8c3223d9a784a1..c412f48606c045 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``.
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',
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"),
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..d85df59b3749f1
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-01-25-03-23-20.gh-issue-144217.E1wVXH.rst
@@ -0,0 +1 @@
+:mod:`mimetypes`: Add support for DICOM files (for medical imaging) with the 
official MIME type ``application/dicom``. Patch by Benedikt Johannes.

_______________________________________________
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]

Reply via email to