* :rfc:`2361`: Change type for ``.avi`` to ``video/vnd.avi``
and for ``.wav`` to ``audio/vnd.wave``
- * :rfc:`4337`: Add MPEG-4 ``audio/mp4`` (``.m4a``))
+ * :rfc:`4337`: Add MPEG-4 ``audio/mp4`` (``.m4a``)
* :rfc:`5334`: Add Ogg media (``.oga``, ``.ogg`` and ``.ogx``)
+ * :rfc:`6713`: Add gzip ``application/gzip`` (``.gz``)
* :rfc:`9639`: Add FLAC ``audio/flac`` (``.flac``)
+ * Add 7z ``application/x-7z-compressed`` (``.7z``)
+ * Add Android Package ``application/vnd.android.package-archive`` (``.apk``)
+ when not strict
+ * Add deb ``application/x-debian-package`` (``.deb``)
+ * Add glTF binary ``model/gltf-binary`` (``.glb``)
+ * Add glTF JSON/ASCII ``model/gltf+json`` (``.gltf``)
+ * Add M4V ``video/x-m4v`` (``.m4v``)
+ * Add PHP ``application/x-httpd-php`` (``.php``)
+ * Add RAR ``application/vnd.rar`` (``.rar``)
+ * Add RPM ``application/x-rpm`` (``.rpm``)
+ * Add STL ``model/stl`` (``.stl``)
+ * Add Windows Media Video ``video/x-ms-wmv`` (``.wmv``)
* De facto: Add WebM ``audio/webm`` (``.weba``)
* `ECMA-376
<https://ecma-international.org/publications-and-standards/standards/ecma-376/>`__:
'.js' : 'text/javascript',
'.mjs' : 'text/javascript',
'.epub' : 'application/epub+zip',
+ '.gz' : 'application/gzip',
'.json' : 'application/json',
'.webmanifest': 'application/manifest+json',
'.doc' : 'application/msword',
'.pptx' : 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'.xlsx' : 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'.docx' : 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ '.rar' : 'application/vnd.rar',
'.wasm' : 'application/wasm',
+ '.7z' : 'application/x-7z-compressed',
'.bcpio' : 'application/x-bcpio',
'.cpio' : 'application/x-cpio',
'.csh' : 'application/x-csh',
+ '.deb' : 'application/x-debian-package',
'.dvi' : 'application/x-dvi',
'.gtar' : 'application/x-gtar',
'.hdf' : 'application/x-hdf',
'.cdf' : 'application/x-netcdf',
'.nc' : 'application/x-netcdf',
'.p12' : 'application/x-pkcs12',
+ '.php' : 'application/x-httpd-php',
'.pfx' : 'application/x-pkcs12',
'.ram' : 'application/x-pn-realaudio',
'.pyc' : 'application/x-python-code',
'.pyo' : 'application/x-python-code',
+ '.rpm' : 'application/x-rpm',
'.sh' : 'application/x-sh',
'.shar' : 'application/x-shar',
'.swf' : 'application/x-shockwave-flash',
'.mht' : 'message/rfc822',
'.mhtml' : 'message/rfc822',
'.nws' : 'message/rfc822',
+ '.gltf' : 'model/gltf+json',
+ '.glb' : 'model/gltf-binary',
+ '.stl' : 'model/stl',
'.css' : 'text/css',
'.csv' : 'text/csv',
'.html' : 'text/html',
'.qt' : 'video/quicktime',
'.webm' : 'video/webm',
'.avi' : 'video/vnd.avi',
+ '.m4v' : 'video/x-m4v',
+ '.wmv' : 'video/x-ms-wmv',
'.movie' : 'video/x-sgi-movie',
}
# Please sort these too
common_types = _common_types_default = {
'.rtf' : 'application/rtf',
+ '.apk' : 'application/vnd.android.package-archive',
'.midi': 'audio/midi',
'.mid' : 'audio/midi',
'.jpg' : 'image/jpg',
from platform import win32_edition
from test import support
from test.support import os_helper
-from test.support.script_helper import run_python_until_end
try:
import _winapi
for mime_type, ext in (
("application/epub+zip", ".epub"),
("application/octet-stream", ".bin"),
+ ("application/gzip", ".gz"),
("application/ogg", ".ogx"),
("application/postscript", ".ps"),
("application/vnd.apple.mpegurl", ".m3u"),
("application/vnd.openxmlformats-officedocument.presentationml.presentation", ".pptx"),
("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx"),
("application/vnd.openxmlformats-officedocument.wordprocessingml.document", ".docx"),
+ ("application/vnd.rar", ".rar"),
+ ("application/x-7z-compressed", ".7z"),
+ ("application/x-debian-package", ".deb"),
+ ("application/x-httpd-php", ".php"),
+ ("application/x-rpm", ".rpm"),
("application/x-texinfo", ".texi"),
("application/x-troff", ".roff"),
("application/xml", ".xsl"),
("image/webp", ".webp"),
("image/wmf", ".wmf"),
("message/rfc822", ".eml"),
+ ("model/gltf+json", ".gltf"),
+ ("model/gltf-binary", ".glb"),
+ ("model/stl", ".stl"),
("text/html", ".html"),
("text/plain", ".txt"),
("text/rtf", ".rtf"),
("video/ogg", ".ogv"),
("video/quicktime", ".mov"),
("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)
--- /dev/null
+Add MIME types for ``.7z``, ``.apk``, ``.deb``, ``.glb``, ``.gltf``,
+``.gz``, ``.m4v``, ``.php``, ``.rar``, ``.rpm``, ``.stl`` and ``.wmv``.
+Patch by Hugo van Kemenade.