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

Function get_extended_attrtext

Lib/email/_header_value_parser.py:2395–2411  ·  view source on GitHub ↗

attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%') This is a special parsing routine so that we get a value that includes % escapes as a single string (which we decode as a single string later).

(value)

Source from the content-addressed store, hash-verified

2393 return attribute, value
2394
2395def get_extended_attrtext(value):
2396 """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')
2397
2398 This is a special parsing routine so that we get a value that
2399 includes % escapes as a single string (which we decode as a single
2400 string later).
2401
2402 """
2403 m = _non_extended_attribute_end_matcher(value)
2404 if not m:
2405 raise errors.HeaderParseError(
2406 "expected extended attrtext but found {!r}".format(value))
2407 attrtext = m.group()
2408 value = value[len(attrtext):]
2409 attrtext = ValueTerminal(attrtext, 'extended-attrtext')
2410 _validate_xtext(attrtext)
2411 return attrtext, value
2412
2413def get_extended_attribute(value):
2414 """ [CFWS] 1*extended_attrtext [CFWS]

Callers 2

get_extended_attributeFunction · 0.85
get_parameterFunction · 0.85

Calls 4

ValueTerminalClass · 0.85
_validate_xtextFunction · 0.85
formatMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…