FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add missing MIME types · Issue #129965 · python/cpython · GitHub

Repository navigation

Add missing MIME types #129965

Closed
Closed

Description

Feature or enhancement

Proposal:

https://github.com/mikeckennedy/content-types identifies some common MIME types missing from the default mimetypes list.

Running https://github.com/mikeckennedy/content-types/blob/main/samples/compare_to_builtin.py on Python 3.13 to identify some missing ones:

❯ uv run --python 3.13 --with content-types https://raw.githubusercontent.com/mikeckennedy/content-types/refs/heads/main/samples/compare_to_builtin.py
Compare types in mimetypes vs content-types.
There are 5 types where mimetypes and content-types disagree
mimetypes: .exe application/octet-stream, content-types: .exe application/x-msdownload
mimetypes: .xml text/xml, content-types: .xml application/xml
mimetypes: .wav audio/x-wav, content-types: .wav audio/wav
mimetypes: .dll application/octet-stream, content-types: .dll application/x-msdownload
mimetypes: .obj application/octet-stream, content-types: .obj model/obj

There are 0 types in mimetypes that are not in content-types

There are 31 types in content-types that are not in mimetypes
in_ct_only
.xlsx  -> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.gz    -> application/gzip
.ods   -> application/vnd.oasis.opendocument.spreadsheet
.docx  -> application/vnd.openxmlformats-officedocument.wordprocessingml.document
.gltf  -> model/gltf+json
.rar   -> application/vnd.rar
.php   -> application/x-httpd-php
.7z    -> application/x-7z-compressed
.ogv   -> video/ogg
.odg   -> application/vnd.oasis.opendocument.graphics
.weba  -> audio/webm
.rpm   -> application/x-rpm
.odp   -> application/vnd.oasis.opendocument.presentation
.deb   -> application/x-debian-package
.epub  -> application/epub+zip
.woff2 -> font/woff2
.apk   -> application/vnd.android.package-archive
.glb   -> model/gltf-binary
.map   -> application/json
.tgz   -> application/gzip
.ttf   -> font/ttf
.otf   -> font/otf
.wmv   -> video/x-ms-wmv
.odt   -> application/vnd.oasis.opendocument.text
.ogg   -> audio/ogg
.pptx  -> application/vnd.openxmlformats-officedocument.presentationml.presentation
.m4a   -> audio/mp4
.m4v   -> video/mp4
.flac  -> audio/flac
.woff  -> font/woff
.stl   -> model/stl

With 3.14.0a4:

❯ uv run --python 3.14 --with content-types https://raw.githubusercontent.com/mikeckennedy/content-types/refs/heads/main/samples/compare_to_builtin.py
Compare types in mimetypes vs content-types.
There are 5 types where mimetypes and content-types disagree
mimetypes: .exe application/octet-stream, content-types: .exe application/x-msdownload
mimetypes: .obj application/octet-stream, content-types: .obj model/obj
mimetypes: .xml text/xml, content-types: .xml application/xml
mimetypes: .wav audio/x-wav, content-types: .wav audio/wav
mimetypes: .dll application/octet-stream, content-types: .dll application/x-msdownload

There are 13 types in mimetypes that are not in content-types
.wmf : image/wmf
.mka : audio/matroska
.fits: image/fits
.g3  : image/g3fax
.eot : application/vnd.ms-fontobject
.emf : image/emf
.jp2 : image/jp2
.jpm : image/jpm
.jpx : image/jpx
.t38 : image/t38
.mk3d: video/matroska-3d
.mkv : video/matroska
.tfx : image/tiff-fx

There are 27 types in content-types that are not in mimetypes
in_ct_only
.m4v   -> video/mp4
.wmv   -> video/x-ms-wmv
.odt   -> application/vnd.oasis.opendocument.text
.deb   -> application/x-debian-package
.odp   -> application/vnd.oasis.opendocument.presentation
.gz    -> application/gzip
.xlsx  -> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.map   -> application/json
.apk   -> application/vnd.android.package-archive
.gltf  -> model/gltf+json
.php   -> application/x-httpd-php
.glb   -> model/gltf-binary
.rpm   -> application/x-rpm
.epub  -> application/epub+zip
.odg   -> application/vnd.oasis.opendocument.graphics
.docx  -> application/vnd.openxmlformats-officedocument.wordprocessingml.document
.ods   -> application/vnd.oasis.opendocument.spreadsheet
.7z    -> application/x-7z-compressed
.stl   -> model/stl
.m4a   -> audio/mp4
.ogv   -> video/ogg
.flac  -> audio/flac
.rar   -> application/vnd.rar
.tgz   -> application/gzip
.pptx  -> application/vnd.openxmlformats-officedocument.presentationml.presentation
.ogg   -> audio/ogg
.weba  -> audio/webm

Let's add some of these, but check with IANA and relevant specs. For example, .wav is in RFC 2361 as audio/vnd.wave not audio/wav. We currently have it as audio/x-wav.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Feb 10, 2025
  2. added a commit that references this issue on Feb 21, 2025
  3. added a commit that references this issue on Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL