Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Lib/mailcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import warnings
from shlex import quote

__all__ = ["getcaps","findmatch"]

Expand Down Expand Up @@ -203,8 +204,6 @@ def subst(field, MIMEtype, filename, plist=[]):
c = field[i]; i = i+1
if c == '%':
res = res + c
elif c == 's':
res = res + filename
elif c == 't':
res = res + MIMEtype
elif c == '{':
Expand All @@ -219,6 +218,9 @@ def subst(field, MIMEtype, filename, plist=[]):
# %F == list of alternating type and filename for parts
else:
res = res + '%' + c
res = res.replace("'%s'" , quote(filename))
res = res.replace('"%s"' , quote(filename))
res = res.replace('%s' , quote(filename))
return res

def findparam(name, plist):
Expand Down