Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit303043f

Browse files
authored
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
1 parent3402e13 commit303043f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎Lib/mimetypes.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def add_type(self, type, ext, strict=True):
9090
list of standard types, else to the list of non-standard
9191
types.
9292
"""
93+
ifnottype:
94+
return
9395
self.types_map[strict][ext]=type
9496
exts=self.types_map_inv[strict].setdefault(type, [])
9597
ifextnotinexts:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix:func:`mimetypes.guess_type` to use default mapping for empty
2+
``Content-Type`` in registry.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp