-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-140392: Add application
MIME types in Lib/mimetypes.py
#140393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 11 commits
5a31dae
150066b
fd4c130
f9bcff5
a8cce21
ece6041
9e1e257
8edf346
cca3f64
d8d96cf
548857a
04a70e2
0067040
8788994
3d7e066
4adcde0
5d3ccd2
4f0d259
9568995
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know we (and especially me!) have been adding new MIME types to this test, but I'm now thinking there's not much point, we're essentially duplicating It's useful to have some in here, to test the lookup works, but we don't really need all. When we have multiple extensions (for example, I'm not suggesting removing all existing ones, but shall we remove the new ones here, other than for |
||
("application/epub+zip", ".epub"), | ||
('application/json', '.json'), | ||
('application/manifest+json', '.webmanifest'), | ||
('applicaion/mathematica', '.nb'), | ||
clin1234 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
('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"), | ||
|
@@ -309,7 +322,7 @@ def check_file_type(): | |
("video/mpeg", ".mpe"), | ||
("video/mpeg", ".mpeg"), | ||
("video/mpeg", ".mpg"), | ||
): | ||
): | ||
clin1234 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
with self.subTest(mime_type=mime_type, ext=ext): | ||
result, _ = mimetypes.guess_file_type(f"filename{ext}") | ||
self.assertEqual(result, mime_type) | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||
Add the following: | ||||||||||||||||||||||||||||||||||||||||||||
|
Add the following: | |
Add the following MIME types: | |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort and remove duplicate:
- ``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`` | |
- ``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`` |
Uh oh!
There was an error while loading. Please reload this page.