From b0fa8942c32e35758a7993c44a8d959375950719 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 9 Mar 2026 21:39:46 -0400 Subject: [PATCH 1/7] Add additional MIME types for Microsoft formats --- Lib/test/test_mimetypes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index fe7584f1f9d3b3..838d6ec1e7561c 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -235,9 +235,13 @@ def check_extensions(): ("application/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), + ("application/vnd.microsoft.portable-executable", ".exe"), + ("application/vnd.ms-cab-compressed", ".cab"), ("application/vnd.ms-excel", ".xls"), ("application/vnd.ms-fontobject", ".eot"), + ("application/vnd.ms-htmlhelp", ".chm"), ("application/vnd.ms-powerpoint", ".ppt"), + ("application/vnd.ms-officetheme", ".thmx"), ("application/vnd.oasis.opendocument.graphics", ".odg"), ("application/vnd.oasis.opendocument.presentation", ".odp"), ("application/vnd.oasis.opendocument.spreadsheet", ".ods"), @@ -275,6 +279,7 @@ def check_extensions(): ("image/t38", ".t38"), ("image/tiff", ".tiff"), ("image/tiff-fx", ".tfx"), + ("image/vnd.microsoft.icon", ".ico"), ("image/webp", ".webp"), ("image/wmf", ".wmf"), ("message/rfc822", ".eml"), From e443859e7bf2f1dda3d80e78a75e55af58182a18 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 9 Mar 2026 21:42:52 -0400 Subject: [PATCH 2/7] Add MIME types for CAB, CHM, and THMX files Added new MIME types for CAB, CHM, and THMX files. --- Lib/mimetypes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index fc916c470a0110..101c6042f0073f 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -509,9 +509,12 @@ def _default_mime_types(): '.m3u8' : 'application/vnd.apple.mpegurl', '.dll' : 'application/vnd.microsoft.portable-executable', '.exe' : 'application/vnd.microsoft.portable-executable', + '.cab' : 'application/vnd.ms-cab-compressed', '.xls' : 'application/vnd.ms-excel', '.xlb' : 'application/vnd.ms-excel', '.eot' : 'application/vnd.ms-fontobject', + '.chm' : 'application/vnd.ms-htmlhelp', + '.thmx' : 'application/vnd.ms-officetheme', '.ppt' : 'application/vnd.ms-powerpoint', '.pot' : 'application/vnd.ms-powerpoint', '.ppa' : 'application/vnd.ms-powerpoint', From 35ecf5b9f9b592dc65e64aa0cc1e3db74504464f Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 01:48:14 +0000 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst diff --git a/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst b/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst new file mode 100644 index 00000000000000..59ecf280461e1a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst @@ -0,0 +1 @@ +Add a few Microsoft-specific MIME types, and synchronize between ``mimetypes`` module and tests From a3f258c04950639c1c9f1823625e769f40733b6f Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 10 Mar 2026 08:24:15 -0400 Subject: [PATCH 4/7] Update Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .../next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst b/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst index 59ecf280461e1a..55ef5206c992cd 100644 --- a/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst +++ b/Misc/NEWS.d/next/Library/2026-03-10-01-48-12.gh-issue-145717.dPc0Rt.rst @@ -1 +1 @@ -Add a few Microsoft-specific MIME types, and synchronize between ``mimetypes`` module and tests +Add a few Microsoft-specific MIME types. From 68239a19f822374561f862845b473b42ae2a1c2d Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 10 Mar 2026 08:24:28 -0400 Subject: [PATCH 5/7] Update Lib/test/test_mimetypes.py Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_mimetypes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 838d6ec1e7561c..04fbed98d2b0d8 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -235,8 +235,6 @@ def check_extensions(): ("application/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), - ("application/vnd.microsoft.portable-executable", ".exe"), - ("application/vnd.ms-cab-compressed", ".cab"), ("application/vnd.ms-excel", ".xls"), ("application/vnd.ms-fontobject", ".eot"), ("application/vnd.ms-htmlhelp", ".chm"), From 8e501ae392a6db37d97fc22e4c4035d2905e99f1 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 10 Mar 2026 08:24:38 -0400 Subject: [PATCH 6/7] Update Lib/test/test_mimetypes.py Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_mimetypes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 04fbed98d2b0d8..d9bda53c7850d1 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -237,9 +237,7 @@ def check_extensions(): ("application/vnd.apple.mpegurl", ".m3u"), ("application/vnd.ms-excel", ".xls"), ("application/vnd.ms-fontobject", ".eot"), - ("application/vnd.ms-htmlhelp", ".chm"), ("application/vnd.ms-powerpoint", ".ppt"), - ("application/vnd.ms-officetheme", ".thmx"), ("application/vnd.oasis.opendocument.graphics", ".odg"), ("application/vnd.oasis.opendocument.presentation", ".odp"), ("application/vnd.oasis.opendocument.spreadsheet", ".ods"), From 6e1dfe5c993420d20e054e9dc9bc403097a87cb1 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 10 Mar 2026 08:24:45 -0400 Subject: [PATCH 7/7] Update Lib/test/test_mimetypes.py Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_mimetypes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index d9bda53c7850d1..fe7584f1f9d3b3 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -275,7 +275,6 @@ def check_extensions(): ("image/t38", ".t38"), ("image/tiff", ".tiff"), ("image/tiff-fx", ".tfx"), - ("image/vnd.microsoft.icon", ".ico"), ("image/webp", ".webp"), ("image/wmf", ".wmf"), ("message/rfc822", ".eml"),