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

Function _find_mime_parameters

Lib/email/_header_value_parser.py:2680–2694  ·  view source on GitHub ↗

Do our best to find the parameters in an invalid MIME header

(tokenlist, value)

Source from the content-addressed store, hash-verified

2678 return mime_parameters
2679
2680def _find_mime_parameters(tokenlist, value):
2681 """Do our best to find the parameters in an invalid MIME header
2682
2683 """
2684 while value and value[0] != ';':
2685 if value[0] in PHRASE_ENDS:
2686 tokenlist.append(ValueTerminal(value[0], 'misplaced-special'))
2687 value = value[1:]
2688 else:
2689 token, value = get_phrase(value)
2690 tokenlist.append(token)
2691 if not value:
2692 return
2693 tokenlist.append(ValueTerminal(';', 'parameter-separator'))
2694 tokenlist.append(parse_mime_parameters(value[1:]))
2695
2696def parse_content_type_header(value):
2697 """ maintype "/" subtype *( ";" parameter )

Callers 2

Calls 4

ValueTerminalClass · 0.85
get_phraseFunction · 0.85
parse_mime_parametersFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…