8000 gh-144217: Add dicom support (medical imaging) to mimetypes (GH-144218) · python/cpython@76d3ae7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76d3ae7

Browse files
benediktjohannesblurb-it[bot]ZeroIntensity
authored
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 <zintensitydev@gmail.com>
1 parent 6e55337 commit 76d3ae7

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ math
603603
mimetypes
604604
---------
605605

606+
* Add ``application/dicom`` MIME type for ``.dcm`` extension. (Contributed by Benedikt Johannes in :gh:`144217`.)
606607
* Add ``application/node`` MIME type for ``.cjs`` extension. (Contributed by John Franey in :gh:`140937`.)
607608
* Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.)
608609
* Rename ``application/x-texinfo`` to ``application/texinfo``.

Lib/mimetypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ def _default_mime_types():
477477
types_map = _types_map_default = {
478478
'.js' : 'text/javascript',
479479
'.mjs' : 'text/javascript',
480+
'.dcm' : 'application/dicom',
480481
'.epub' : 'application/epub+zip',
481482
'.gz' : 'application/gzip',
482483
'.json' : 'application/json',

Lib/test/test_mimetypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def check_extensions():
226226
for mime_type, ext in (
227227
("application/epub+zip", ".epub"),
228228
("application/octet-stream", ".bin"),
229+
("application/dicom", ".dcm"),
229230
("application/gzip", ".gz"),
230231
("application/ogg", ".ogx"),
231232
("application/pdf", ".pdf"),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:mod:`mimetypes`: Add support for DICOM files (for medical imaging) with the official MIME type ``application/dicom``. Patch by Benedikt Johannes.

0 commit comments

Comments
 (0)
0