Skip to content

Commit 0874c07

Browse files
committed
Update documentation
1 parent 50552fa commit 0874c07

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Doc/library/mimetypes.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ the information :func:`init` sets up.
3939
(e.g. :program:`compress` or :program:`gzip`). The encoding is suitable for use
4040
as a :mailheader:`Content-Encoding` header, **not** as a
4141
:mailheader:`Content-Transfer-Encoding` header. The mappings are table driven.
42-
Encoding suffixes are case sensitive. Suffix mappings and type suffixes are
43-
first tried case sensitively, then case insensitively.
42+
Encoding suffixes are case-sensitive. Suffix mappings and type suffixes are
43+
first tried case-sensitively, then case-insensitively.
4444

4545
The optional *strict* argument is a flag specifying whether the list of known MIME types
4646
is limited to only the official types `registered with IANA
@@ -131,6 +131,8 @@ behavior of the module.
131131
is already known the extension will be added to the list of known extensions.
132132
Valid extensions are empty or start with a ``'.'``.
133133

134+
Registered lower-case extensions are matched case-insensitively.
135+
134136
When *strict* is ``True`` (the default), the mapping will be added to the
135137
official MIME types, otherwise to the non-standard ones.
136138

@@ -312,6 +314,8 @@ than one MIME-type database; it provides an interface similar to the one of the
312314
extension is already known, the new type will replace the old one. When the type
313315
is already known the extension will be added to the list of known extensions.
314316

317+
Registered lower-case extensions are matched case-insensitively.
318+
315319
When *strict* is ``True`` (the default), the mapping will be added to the
316320
official MIME types, otherwise to the non-standard ones.
317321

Lib/mimetypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def add_type(self, type, ext, strict=True):
8686
is already known the extension will be added
8787
to the list of known extensions.
8888
89+
Registered lower-case extensions are matched
90+
case-insensitively.
91+
8992
If strict is true, information will be added to
9093
list of standard types, else to the list of non-standard
9194
types.
@@ -396,6 +399,9 @@ def add_type(type, ext, strict=True):
396399
is already known the extension will be added
397400
to the list of known extensions.
398401
402+
Registered lower-case extensions are matched
403+
case-insensitively.
404+
399405
If strict is true, information will be added to
400406
list of standard types, else to the list of non-standard
401407
types.

0 commit comments

Comments
 (0)