MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_dtext

Function get_dtext

Lib/email/_header_value_parser.py:1555–1573  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1553 return obs_local_part, value
1554
1555def 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&#x27;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&#x27;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
1575def _check_for_early_dl_end(value, domain_literal):
1576 if value:

Callers 2

get_domain_literalFunction · 0.85
get_no_fold_literalFunction · 0.85

Calls 4

_get_ptext_to_endcharsFunction · 0.85
ValueTerminalClass · 0.85
_validate_xtextFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected