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

Function get_qp_ctext

Lib/email/_header_value_parser.py:1191–1206  ·  view source on GitHub ↗

r"""ctext = This is not the RFC ctext, since we are handling nested comments in comment and unquoting quoted-pairs here. We allow anything except the '()' characters, but if we find any ASCII other than the RFC defined printable ASCII, a NonPrintableD

(value)

Source from the content-addressed store, hash-verified

1189 return unstructured
1190
1191def get_qp_ctext(value):
1192 r"""ctext = <printable ascii except \ ( )>
1193
1194 This is not the RFC ctext, since we are handling nested comments in comment
1195 and unquoting quoted-pairs here. We allow anything except the '()'
1196 characters, but if we find any ASCII other than the RFC defined printable
1197 ASCII, a NonPrintableDefect is added to the token&#x27;s defects list. Since
1198 quoted pairs are converted to their unquoted values, what is returned is
1199 a 'ptext' token. In this case it is a WhiteSpaceTerminal, so it&#x27;s value
1200 is ' '.
1201
1202 """
1203 ptext, value, _ = _get_ptext_to_endchars(value, '()')
1204 ptext = WhiteSpaceTerminal(ptext, 'ptext')
1205 _validate_xtext(ptext)
1206 return ptext, value
1207
1208def get_qcontent(value):
1209 """qcontent = qtext / quoted-pair

Callers 1

get_commentFunction · 0.85

Calls 3

_get_ptext_to_endcharsFunction · 0.85
WhiteSpaceTerminalClass · 0.85
_validate_xtextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…