attrtext = 1*(any non-ATTRIBUTE_ENDS character) We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the token's defects list if we find non-attrtext characters. We also register defects for *any* non-printables even though the RFC doesn't exclude all of them, because we
(value)
| 2351 | return mtoken, value |
| 2352 | |
| 2353 | def get_attrtext(value): |
| 2354 | """attrtext = 1*(any non-ATTRIBUTE_ENDS character) |
| 2355 | |
| 2356 | We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the |
| 2357 | token's defects list if we find non-attrtext characters. We also register |
| 2358 | defects for *any* non-printables even though the RFC doesn't exclude all of |
| 2359 | them, because we follow the spirit of RFC 5322. |
| 2360 | |
| 2361 | """ |
| 2362 | m = _non_attribute_end_matcher(value) |
| 2363 | if not m: |
| 2364 | raise errors.HeaderParseError( |
| 2365 | "expected attrtext but found {!r}".format(value)) |
| 2366 | attrtext = m.group() |
| 2367 | value = value[len(attrtext):] |
| 2368 | attrtext = ValueTerminal(attrtext, 'attrtext') |
| 2369 | _validate_xtext(attrtext) |
| 2370 | return attrtext, value |
| 2371 | |
| 2372 | def get_attribute(value): |
| 2373 | """ [CFWS] 1*attrtext [CFWS] |
no test coverage detected
searching dependent graphs…