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

gh-146343: Add `text` MIME types in mimetypes.py by clin1234 · Pull Request #146344 · python/cpython · GitHub

Repository navigation

Open
2 changes: 2 additions & 0 deletions Doc/whatsnew/3.16.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,8 @@ mimetypes
Valid extensions must now start with a ``'.'`` or be empty;
undotted extensions raise a :exc:`ValueError`.
(Contributed by Nikita Sobolev in :gh:`149720`.)
* Add more MIME types
(Contributed by Charlie Lin in :gh:`146344`.)

shutil
------
Expand Down
26 changes: 26 additions & 0 deletions Lib/mimetypes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -657,30 +657,56 @@ def _default_mime_types():
'.gltf' : 'model/gltf+json',
'.glb' : 'model/gltf-binary',
'.stl' : 'model/stl',
'.appcache' : 'text/cache-manifest',
'.manifest' : 'text/cache-manifest',
'.ics' : 'text/calendar',
'.ifb' : 'text/calendar',
'.cql' : 'text/cql',
'.css' : 'text/css',
'.csv' : 'text/csv',
'.csvs' : 'text/csv-schema',
'.gff3' : 'text/gff3',
'.html' : 'text/html',
'.htm' : 'text/html',
'.cnd' : 'text/jcr-cnd',
'.md' : 'text/markdown',
'.markdown': 'text/markdown',
'.miz' : 'text/mizar',
'.n3' : 'text/n3',
'.org' : 'text/org',
'.txt' : 'text/plain',
'.bat' : 'text/plain',
'.c' : 'text/plain',
'.h' : 'text/plain',
'.ksh' : 'text/plain',
'.pl' : 'text/plain',
'.srt' : 'text/plain',
'.provn' : 'text/provenance-notation',
'.rtx' : 'text/richtext',
'.shaclc' : 'text/shaclc',
'.shc' : 'text/shaclc',
'.shex' : 'text/shex',
'.spdx' : 'text/spdx',
'.tsv' : 'text/tab-separated-values',
'.ttl' : 'text/turtle',
'.uri' : 'text/uri-list',
'.uris' : 'text/uri-list',
'.vcard' : 'text/vcard',
'.vcf' : 'text/vcard',
'.ascii' : 'text/vnd.ascii-art',
'.curl' : 'text/vnd.curl',
'.gml' : 'text/vnd.gml',
'.gv' : 'text/vnd.graphviz',
'.vtt' : 'text/vtt',
'.wgsl' : 'text/wgsl',
'.py' : 'text/x-python',
'.rst' : 'text/x-rst',
'.etx' : 'text/x-setext',
'.sgm' : 'text/x-sgml',
'.sgml' : 'text/x-sgml',
'.vcf' : 'text/x-vcard',
'.xml' : 'text/xml',
'.ent' : 'text/xml-external-parsed-entity',
'.mkv' : 'video/matroska',
'.mk3d' : 'video/matroska-3d',
'.mp4' : 'video/mp4',
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Add the following MIME types with file extensions:
``.appcache`` and ``.manifest`` for ``text/cache-manifest``
``.ics`` and ``.ifb`` for ``text/calendar``
``.cql`` for ``text/cql``
``.csvs`` for ``text/csv-schema``
``.gff3`` for ``text/gff3``
``.cnd`` for ``text/jcr-cnd``
``.miz`` for ``text/mizar``
``.org`` for ``text/org``
``.provn`` for ``text/provenance-notation``
``.shaclc`` and ``.shc`` for ``text/shaclc``
``.shex`` for ``text/shex``
``.spdx`` for ``text/spdx``
``.ttl`` for ``text/turtle``
``.uri`` and ``.uris`` for ``text/uri-list``
``.vcard`` and ``.vcf`` for ``text/vcard``
``.ascii`` for ``text/vnd.ascii-art``
``.curl`` for ``text/vnd.curl``
``.gml`` for ``text/vnd.gml``
``.gv`` for ``text/vnd.graphviz``
``.wgsl`` for ``text/wgsl``
``.ent`` for ``text/xml-external-parsed-entity``
Loading

Back | FazBrowse Home | New Git URL