MCPcopy Index your code
hub / github.com/python/cpython / _get_params_preserve

Method _get_params_preserve

Lib/email/message.py:668–687  ·  view source on GitHub ↗
(self, failobj, header)

Source from the content-addressed store, hash-verified

666 self._default_type = ctype
667
668 def _get_params_preserve(self, failobj, header):
669 # Like get_params() but preserves the quoting of values. BAW:
670 # should this be part of the public interface?
671 missing = object()
672 value = self.get(header, missing)
673 if value is missing:
674 return failobj
675 params = []
676 for p in _parseparam(value):
677 try:
678 name, val = p.split('=', 1)
679 name = name.strip()
680 val = val.strip()
681 except ValueError:
682 # Must have been a bare attribute
683 name = p.strip()
684 val = ''
685 params.append((name, val))
686 params = utils.decode_params(params)
687 return params
688
689 def get_params(self, failobj=None, header='content-type', unquote=True):
690 """Return the message's Content-Type parameters, as a list.

Callers 3

get_paramsMethod · 0.95
get_paramMethod · 0.95
set_boundaryMethod · 0.95

Calls 5

getMethod · 0.95
_parseparamFunction · 0.85
splitMethod · 0.45
stripMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected