r""" dtext = / obs-dtext obs-dtext = obs-NO-WS-CTL / quoted-pair We allow anything except the excluded characters, but if we find any ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is added to the token's defects list. Quot
(value)
| 1553 | return obs_local_part, value |
| 1554 | |
| 1555 | def get_dtext(value): |
| 1556 | r""" dtext = <printable ascii except \ [ ]> / obs-dtext |
| 1557 | obs-dtext = obs-NO-WS-CTL / quoted-pair |
| 1558 | |
| 1559 | We allow anything except the excluded characters, but if we find any |
| 1560 | ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is |
| 1561 | added to the token's defects list. Quoted pairs are converted to their |
| 1562 | unquoted values, so what is returned is a ptext token, in this case a |
| 1563 | ValueTerminal. If there were quoted-printables, an ObsoleteHeaderDefect is |
| 1564 | added to the returned token's defect list. |
| 1565 | |
| 1566 | """ |
| 1567 | ptext, value, had_qp = _get_ptext_to_endchars(value, '[]') |
| 1568 | ptext = ValueTerminal(ptext, 'ptext') |
| 1569 | if had_qp: |
| 1570 | ptext.defects.append(errors.ObsoleteHeaderDefect( |
| 1571 | "quoted printable found in domain-literal")) |
| 1572 | _validate_xtext(ptext) |
| 1573 | return ptext, value |
| 1574 | |
| 1575 | def _check_for_early_dl_end(value, domain_literal): |
| 1576 | if value: |
no test coverage detected