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

Function _validate_xtext

Lib/email/_header_value_parser.py:1021–1029  ·  view source on GitHub ↗

If input token contains ASCII non-printables, register a defect.

(xtext)

Source from the content-addressed store, hash-verified

1019 re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match
1020
1021def _validate_xtext(xtext):
1022 """If input token contains ASCII non-printables, register a defect."""
1023
1024 non_printables = _non_printable_finder(xtext)
1025 if non_printables:
1026 xtext.defects.append(errors.NonPrintableDefect(non_printables))
1027 if utils._has_surrogates(xtext):
1028 xtext.defects.append(errors.UndecodableBytesDefect(
1029 "Non-ASCII characters found in header token"))
1030
1031def _get_ptext_to_endchars(value, endchars):
1032 """Scan printables/quoted-pairs until endchars and return unquoted ptext.

Callers 9

get_encoded_wordFunction · 0.85
get_unstructuredFunction · 0.85
get_qp_ctextFunction · 0.85
get_qcontentFunction · 0.85
get_atextFunction · 0.85
get_dtextFunction · 0.85
get_ttextFunction · 0.85
get_attrtextFunction · 0.85
get_extended_attrtextFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…