From 5a31dae31f6b8be88f26bdf5eb9d355c85a6fcbb Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 20 Oct 2025 19:00:55 -0400 Subject: [PATCH 01/20] Add `application` MIME types in Lib/mimetypes.py --- Lib/mimetypes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 48a9f430d45262..180ccef6df6d25 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -477,10 +477,16 @@ def _default_mime_types(): types_map = _types_map_default = { '.js' : 'text/javascript', '.mjs' : 'text/javascript', + '.efi' : 'applicaion/efi', '.epub' : 'application/epub+zip', '.gz' : 'application/gzip', '.json' : 'application/json', '.webmanifest': 'application/manifest+json', + '.nb' : 'applicaion/mathematica', + '.ma' : 'applicaion/mathematica', + '.mb' : 'applicaion/mathematica', + '.mml' : 'application/mathml+xml', + '.mbox' : 'application/mbox', '.doc' : 'application/msword', '.dot' : 'application/msword', '.wiz' : 'application/msword', @@ -493,13 +499,19 @@ def _default_mime_types(): '.o' : 'application/octet-stream', '.obj' : 'application/octet-stream', '.so' : 'application/octet-stream', + '.ors' : 'application/ocsp-response', + '.orq' : 'application/ocsp-request', '.oda' : 'application/oda', '.ogx' : 'application/ogg', '.pdf' : 'application/pdf', + '.pem' : 'application/pem-certificate-chain', + '.asc' : 'application/pgp-keys', '.p7c' : 'application/pkcs7-mime', '.ps' : 'application/postscript', '.ai' : 'application/postscript', '.eps' : 'application/postscript', + '.rfcxml' : 'application/rfc+xml', + '.sql' : 'application/sql', '.texi' : 'application/texinfo', '.texinfo': 'application/texinfo', '.toml' : 'application/toml', @@ -566,6 +578,7 @@ def _default_mime_types(): '.yaml' : 'application/yaml', '.yml' : 'application/yaml', '.zip' : 'application/zip', + '.zst' : 'application/zstd', '.3gp' : 'audio/3gpp', '.3gpp' : 'audio/3gpp', '.3g2' : 'audio/3gpp2', From 150066b904178bdf431b9fd78b7d559f02dda23e Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 20 Oct 2025 19:08:47 -0400 Subject: [PATCH 02/20] Add `application` MIME types in Lib/test/test_mimetypes.py --- Lib/test/test_mimetypes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 746984ec0ca9df..e1d0b50de5e4b3 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -225,11 +225,23 @@ def test_guess_known_extensions(self): def test_preferred_extension(self): def check_extensions(): for mime_type, ext in ( + ('applicaion/efi','.efi' ), ("application/epub+zip", ".epub"), + ( 'application/json','.json' ), + ( 'application/manifest+json','.webmanifest'), + ('applicaion/mathematica','.nb' ), + ( 'application/mathml+xml','.mml' ), + ( 'application/mbox','.mbox' ), ("application/octet-stream", ".bin"), ("application/gzip", ".gz"), + ( 'application/ocsp-response','.ors' ), + ( 'application/ocsp-request','.orq' ), + ('application/pem-certificate-chain','.pem' ), + ('application/pgp-keys','.asc' ), ("application/ogg", ".ogx"), ("application/postscript", ".ps"), + ( 'application/rfc+xml','.rfcxml' ), + ('application/sql','.sql' ), ("application/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), @@ -251,6 +263,7 @@ def check_extensions(): ("application/x-troff", ".roff"), ("application/xml", ".xsl"), ("application/yaml", ".yaml"), + ('application/zstd','.zst' ), ("audio/flac", ".flac"), ("audio/matroska", ".mka"), ("audio/mp4", ".m4a"), From fd4c130bdf5a63b598519363337ebb633bd953e0 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Mon, 20 Oct 2025 19:15:53 -0400 Subject: [PATCH 03/20] Add new application media types in 3.15 release Added new media types for various applications. --- Doc/whatsnew/3.15.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 8503a4c7f973fc..530f861f87c8a5 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -695,6 +695,18 @@ mimetypes * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) * Rename ``application/x-texinfo`` to ``application/texinfo``. (Contributed by Charlie Lin in :gh:`140165`) +* Add the following (Contributed by Charlie Lin in :gh:`140393`): + - ``application/efi`` + - ``application/pem-certificate-chain`` + - ``application/pgp-keys`` + - ``application/sql`` + - ``application/zstd`` + - ``application/ocsp-request`` + - ``application/ocsp-response`` + - ``application/mathematica`` + - ``application/mathml+xml`` + - ``application/mbox`` + - ``application/pem-certificate-chain`` pathlib From f9bcff5cf959ebbe6f69ebb091f85ecc2ec0a318 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 07:40:54 -0400 Subject: [PATCH 04/20] Proper indentation --- Lib/test/test_mimetypes.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index e1d0b50de5e4b3..2ddfeb5918fc3b 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -134,7 +134,7 @@ def test_filename_with_url_delimiters(self): ';1#.tar.gz', ';&1=123;?.tar.gz', '?k1=v1&k2=v2.tar.gz', - ): + ): for prefix in ('', '/', '\\', 'c:', 'c:/', 'c:\\', 'c:/d/', 'c:\\d\\', '//share/server/', '\\\\share\\server\\'): @@ -225,23 +225,23 @@ def test_guess_known_extensions(self): def test_preferred_extension(self): def check_extensions(): for mime_type, ext in ( - ('applicaion/efi','.efi' ), + ('applicaion/efi', '.efi'), ("application/epub+zip", ".epub"), - ( 'application/json','.json' ), - ( 'application/manifest+json','.webmanifest'), - ('applicaion/mathematica','.nb' ), - ( 'application/mathml+xml','.mml' ), - ( 'application/mbox','.mbox' ), + ('application/json', '.json'), + ('application/manifest+json', '.webmanifest'), + ('applicaion/mathematica', '.nb'), + ('application/mathml+xml', '.mml'), + ('application/mbox', '.mbox'), ("application/octet-stream", ".bin"), ("application/gzip", ".gz"), - ( 'application/ocsp-response','.ors' ), - ( 'application/ocsp-request','.orq' ), - ('application/pem-certificate-chain','.pem' ), - ('application/pgp-keys','.asc' ), + ('application/ocsp-response', '.ors'), + ('application/ocsp-request', '.orq'), + ('application/pem-certificate-chain', '.pem'), + ('application/pgp-keys', '.asc'), ("application/ogg", ".ogx"), ("application/postscript", ".ps"), - ( 'application/rfc+xml','.rfcxml' ), - ('application/sql','.sql' ), + ('application/rfc+xml', '.rfcxml'), + ('application/sql', '.sql'), ("application/texinfo", ".texi"), ("application/toml", ".toml"), ("application/vnd.apple.mpegurl", ".m3u"), @@ -263,7 +263,7 @@ def check_extensions(): ("application/x-troff", ".roff"), ("application/xml", ".xsl"), ("application/yaml", ".yaml"), - ('application/zstd','.zst' ), + ('application/zstd', '.zst'), ("audio/flac", ".flac"), ("audio/matroska", ".mka"), ("audio/mp4", ".m4a"), @@ -322,7 +322,7 @@ def check_file_type(): ("video/mpeg", ".mpe"), ("video/mpeg", ".mpeg"), ("video/mpeg", ".mpg"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): result, _ = mimetypes.guess_file_type(f"filename{ext}") self.assertEqual(result, mime_type) @@ -437,10 +437,10 @@ def test_registry_accelerator(self): from_reg = {} _winapi._mimetypes_read_windows_registry( lambda v, k: from_accel.setdefault(k, set()).add(v) - ) + ) mimetypes.MimeTypes._read_windows_registry( lambda v, k: from_reg.setdefault(k, set()).add(v) - ) + ) self.assertEqual(list(from_reg), list(from_accel)) for k in from_reg: self.assertEqual(from_reg[k], from_accel[k]) @@ -490,7 +490,7 @@ def test_multiple_inputs(self): result, "type: application/pdf encoding: None\n" "type: image/png encoding: None" - ) + ) def test_multiple_inputs_error(self): result = "\n".join(mimetypes._main(shlex.split("foo.pdf foo.bar_ext"))) @@ -498,7 +498,7 @@ def test_multiple_inputs_error(self): result, "type: application/pdf encoding: None\n" "error: media type unknown for foo.bar_ext" - ) + ) def test_invocation(self): From a8cce2177daf17e8741a8eba44ee1f380b92bd70 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 07:42:34 -0400 Subject: [PATCH 05/20] Style fix --- Doc/whatsnew/3.15.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 530f861f87c8a5..1eac4656ead103 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -695,7 +695,7 @@ mimetypes * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) * Rename ``application/x-texinfo`` to ``application/texinfo``. (Contributed by Charlie Lin in :gh:`140165`) -* Add the following (Contributed by Charlie Lin in :gh:`140393`): +* Add the following: - ``application/efi`` - ``application/pem-certificate-chain`` - ``application/pgp-keys`` @@ -707,6 +707,7 @@ mimetypes - ``application/mathml+xml`` - ``application/mbox`` - ``application/pem-certificate-chain`` + (Contributed by Charlie Lin in :gh:`140393`) pathlib From ece60418232ddd3828826c586996b5e1cde2ef26 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 08:21:12 -0400 Subject: [PATCH 06/20] Doc lint --- 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 1eac4656ead103..23679717122251 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -707,6 +707,7 @@ mimetypes - ``application/mathml+xml`` - ``application/mbox`` - ``application/pem-certificate-chain`` + (Contributed by Charlie Lin in :gh:`140393`) From 9e1e2575d7f13ecf1eed284284d22bcd6b71788d Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 09:27:33 -0400 Subject: [PATCH 07/20] Revert accidental whitespace misindentation --- Lib/test/test_mimetypes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 2ddfeb5918fc3b..fc5f02263d89b3 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -322,7 +322,7 @@ def check_file_type(): ("video/mpeg", ".mpe"), ("video/mpeg", ".mpeg"), ("video/mpeg", ".mpg"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): result, _ = mimetypes.guess_file_type(f"filename{ext}") self.assertEqual(result, mime_type) @@ -437,10 +437,10 @@ def test_registry_accelerator(self): from_reg = {} _winapi._mimetypes_read_windows_registry( lambda v, k: from_accel.setdefault(k, set()).add(v) - ) + ) mimetypes.MimeTypes._read_windows_registry( lambda v, k: from_reg.setdefault(k, set()).add(v) - ) + ) self.assertEqual(list(from_reg), list(from_accel)) for k in from_reg: self.assertEqual(from_reg[k], from_accel[k]) @@ -490,7 +490,7 @@ def test_multiple_inputs(self): result, "type: application/pdf encoding: None\n" "type: image/png encoding: None" - ) + ) def test_multiple_inputs_error(self): result = "\n".join(mimetypes._main(shlex.split("foo.pdf foo.bar_ext"))) @@ -498,7 +498,7 @@ def test_multiple_inputs_error(self): result, "type: application/pdf encoding: None\n" "error: media type unknown for foo.bar_ext" - ) + ) def test_invocation(self): From 8edf34635f922f4512c0fe776f1f7a069b34139e Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 09:29:54 -0400 Subject: [PATCH 08/20] More reverting --- Lib/test/test_mimetypes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index fc5f02263d89b3..26c24b05adc070 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -134,7 +134,7 @@ def test_filename_with_url_delimiters(self): ';1#.tar.gz', ';&1=123;?.tar.gz', '?k1=v1&k2=v2.tar.gz', - ): + ): for prefix in ('', '/', '\\', 'c:', 'c:/', 'c:\\', 'c:/d/', 'c:\\d\\', '//share/server/', '\\\\share\\server\\'): @@ -322,7 +322,7 @@ def check_file_type(): ("video/mpeg", ".mpe"), ("video/mpeg", ".mpeg"), ("video/mpeg", ".mpg"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): result, _ = mimetypes.guess_file_type(f"filename{ext}") self.assertEqual(result, mime_type) @@ -437,10 +437,10 @@ def test_registry_accelerator(self): from_reg = {} _winapi._mimetypes_read_windows_registry( lambda v, k: from_accel.setdefault(k, set()).add(v) - ) + ) mimetypes.MimeTypes._read_windows_registry( lambda v, k: from_reg.setdefault(k, set()).add(v) - ) + ) self.assertEqual(list(from_reg), list(from_accel)) for k in from_reg: self.assertEqual(from_reg[k], from_accel[k]) @@ -490,7 +490,7 @@ def test_multiple_inputs(self): result, "type: application/pdf encoding: None\n" "type: image/png encoding: None" - ) + ) def test_multiple_inputs_error(self): result = "\n".join(mimetypes._main(shlex.split("foo.pdf foo.bar_ext"))) @@ -498,7 +498,7 @@ def test_multiple_inputs_error(self): result, "type: application/pdf encoding: None\n" "error: media type unknown for foo.bar_ext" - ) + ) def test_invocation(self): From cca3f64a339b52ddfa8bc0f4d23601cb7f6025ce Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 09:30:54 -0400 Subject: [PATCH 09/20] Hopefully the last misindents should be fixed... --- Lib/test/test_mimetypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 26c24b05adc070..e54579ad21d49e 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -134,7 +134,7 @@ def test_filename_with_url_delimiters(self): ';1#.tar.gz', ';&1=123;?.tar.gz', '?k1=v1&k2=v2.tar.gz', - ): + ): for prefix in ('', '/', '\\', 'c:', 'c:/', 'c:\\', 'c:/d/', 'c:\\d\\', '//share/server/', '\\\\share\\server\\'): @@ -303,7 +303,7 @@ def check_extensions(): ("video/vnd.avi", ".avi"), ("video/x-m4v", ".m4v"), ("video/x-ms-wmv", ".wmv"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): self.assertEqual(mimetypes.guess_extension(mime_type), ext) From d8d96cfec10eb9a590378e724e7813e700c8cec1 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Tue, 21 Oct 2025 12:12:05 -0400 Subject: [PATCH 10/20] Spacing --- Lib/test/test_mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index e54579ad21d49e..74378ef61271b6 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -303,7 +303,7 @@ def check_extensions(): ("video/vnd.avi", ".avi"), ("video/x-m4v", ".m4v"), ("video/x-ms-wmv", ".wmv"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): self.assertEqual(mimetypes.guess_extension(mime_type), ext) From 548857aa7473ebf0deee8809e18121b07b925f40 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:40:00 +0000 Subject: [PATCH 11/20] =?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 --- .../2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst diff --git a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst new file mode 100644 index 00000000000000..0278c9268ea3a9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst @@ -0,0 +1,12 @@ +Add the following: + - ``application/efi`` + - ``application/pem-certificate-chain`` + - ``application/pgp-keys`` + - ``application/sql`` + - ``application/zstd`` + - ``application/ocsp-request`` + - ``application/ocsp-response`` + - ``application/mathematica`` + - ``application/mathml+xml`` + - ``application/mbox`` + - ``application/pem-certificate-chain`` From 04a70e273e8698fc4c20a390b92b525ccec8e67a Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:12:30 +0000 Subject: [PATCH 12/20] Update Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .../2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst index 0278c9268ea3a9..b70fb4e15134a8 100644 --- a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst +++ b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst @@ -1,12 +1,11 @@ Add the following: - ``application/efi`` + - ``application/mathematica`` + - ``application/mathml+xml`` + - ``application/mbox`` + - ``application/ocsp-request`` + - ``application/ocsp-response`` - ``application/pem-certificate-chain`` - ``application/pgp-keys`` - ``application/sql`` - ``application/zstd`` - - ``application/ocsp-request`` - - ``application/ocsp-response`` - - ``application/mathematica`` - - ``application/mathml+xml`` - - ``application/mbox`` - - ``application/pem-certificate-chain`` From 0067040e6bc781383d2f0e9caf11ffbab83b94c0 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:12:40 +0000 Subject: [PATCH 13/20] Update Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- .../Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst index b70fb4e15134a8..9e5141e52671eb 100644 --- a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst +++ b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst @@ -1,4 +1,5 @@ -Add the following: +Add the following MIME types: + - ``application/efi`` - ``application/mathematica`` - ``application/mathml+xml`` From 87889945939c7e8a8f786dd12d2937707774cec1 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:14:28 +0000 Subject: [PATCH 14/20] Apply suggestion from @hugovk Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 74378ef61271b6..9a9bc456328ba5 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -322,7 +322,7 @@ def check_file_type(): ("video/mpeg", ".mpe"), ("video/mpeg", ".mpeg"), ("video/mpeg", ".mpg"), - ): + ): with self.subTest(mime_type=mime_type, ext=ext): result, _ = mimetypes.guess_file_type(f"filename{ext}") self.assertEqual(result, mime_type) From 3d7e06674b04eeb1bba3d4d9170ee1366f52f2b6 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:14:52 +0000 Subject: [PATCH 15/20] Apply spelling suggestion from @hugovk Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/test/test_mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 9a9bc456328ba5..3279920ef46e22 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -229,7 +229,7 @@ def check_extensions(): ("application/epub+zip", ".epub"), ('application/json', '.json'), ('application/manifest+json', '.webmanifest'), - ('applicaion/mathematica', '.nb'), + ('application/mathematica', '.nb'), ('application/mathml+xml', '.mml'), ('application/mbox', '.mbox'), ("application/octet-stream", ".bin"), From 4adcde08ab10e1168e241c0690e8a6e66065c397 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:15:07 +0000 Subject: [PATCH 16/20] Apply suggestion from @hugovk Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/mimetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 180ccef6df6d25..5341f0ef723cfa 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -477,7 +477,7 @@ def _default_mime_types(): types_map = _types_map_default = { '.js' : 'text/javascript', '.mjs' : 'text/javascript', - '.efi' : 'applicaion/efi', + '.efi' : 'application/efi', '.epub' : 'application/epub+zip', '.gz' : 'application/gzip', '.json' : 'application/json', From 5d3ccd27f71acfba9eb95e0abcc0eb65a21c399c Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:15:16 +0000 Subject: [PATCH 17/20] Apply suggestion from @hugovk Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Lib/mimetypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 5341f0ef723cfa..f7372d8b1341b5 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -482,9 +482,9 @@ def _default_mime_types(): '.gz' : 'application/gzip', '.json' : 'application/json', '.webmanifest': 'application/manifest+json', - '.nb' : 'applicaion/mathematica', - '.ma' : 'applicaion/mathematica', - '.mb' : 'applicaion/mathematica', + '.nb' : 'application/mathematica', + '.ma' : 'application/mathematica', + '.mb' : 'application/mathematica', '.mml' : 'application/mathml+xml', '.mbox' : 'application/mbox', '.doc' : 'application/msword', From 4f0d259ebe24ea62857177f0f7406605cacd4624 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 12:25:06 +0000 Subject: [PATCH 18/20] FIx indentation in Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- ...-10-21-16-39-58.gh-issue-140392.ouL6FW.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst index 9e5141e52671eb..b4628bd9db4ec8 100644 --- a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst +++ b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst @@ -1,12 +1,12 @@ Add the following MIME types: - - ``application/efi`` - - ``application/mathematica`` - - ``application/mathml+xml`` - - ``application/mbox`` - - ``application/ocsp-request`` - - ``application/ocsp-response`` - - ``application/pem-certificate-chain`` - - ``application/pgp-keys`` - - ``application/sql`` - - ``application/zstd`` +- ``application/efi`` +- ``application/mathematica`` +- ``application/mathml+xml`` +- ``application/mbox`` +- ``application/ocsp-request`` +- ``application/ocsp-response`` +- ``application/pem-certificate-chain`` +- ``application/pgp-keys`` +- ``application/sql`` +- ``application/zstd`` From 9568995aab540385af7d1b1bb694bc55db4b3e74 Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Wed, 22 Oct 2025 15:18:56 +0000 Subject: [PATCH 19/20] Tidy up Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- .../next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst index b4628bd9db4ec8..b0bebad5bfe35c 100644 --- a/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst +++ b/Misc/NEWS.d/next/Library/2025-10-21-16-39-58.gh-issue-140392.ouL6FW.rst @@ -1,4 +1,4 @@ -Add the following MIME types: +:mod:`mimetypes`: Add the following MIME types: - ``application/efi`` - ``application/mathematica`` From 0cd3b962982ffac5372e5ed4ba1a3907bcae01ee Mon Sep 17 00:00:00 2001 From: Charlie Lin Date: Thu, 23 Oct 2025 08:50:18 -0400 Subject: [PATCH 20/20] 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, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 3279920ef46e22..107c473f490a59 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -225,7 +225,7 @@ def test_guess_known_extensions(self): def test_preferred_extension(self): def check_extensions(): for mime_type, ext in ( - ('applicaion/efi', '.efi'), + ('application/efi', '.efi'), ("application/epub+zip", ".epub"), ('application/json', '.json'), ('application/manifest+json', '.webmanifest'),