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

Function get_dtext

Lib/email/_header_value_parser.py:1572–1590  ·  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

1570 return obs_local_part, value
1571
1572def get_dtext(value):
1573 r""" dtext = <printable ascii except \ [ ]> / obs-dtext
1574 obs-dtext = obs-NO-WS-CTL / quoted-pair
1575
1576 We allow anything except the excluded characters, but if we find any
1577 ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
1578 added to the token&#x27;s defects list. Quoted pairs are converted to their
1579 unquoted values, so what is returned is a ptext token, in this case a
1580 ValueTerminal. If there were quoted-printables, an ObsoleteHeaderDefect is
1581 added to the returned token&#x27;s defect list.
1582
1583 """
1584 ptext, value, had_qp = _get_ptext_to_endchars(value, '[]')
1585 ptext = ValueTerminal(ptext, 'ptext')
1586 if had_qp:
1587 ptext.defects.append(errors.ObsoleteHeaderDefect(
1588 "quoted printable found in domain-literal"))
1589 _validate_xtext(ptext)
1590 return ptext, value
1591
1592def _check_for_early_dl_end(value, domain_literal):
1593 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…