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

Function _validate_xtext

Lib/email/_header_value_parser.py:1004–1012  ·  view source on GitHub ↗

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

(xtext)

Source from the content-addressed store, hash-verified

1002 re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match
1003
1004def _validate_xtext(xtext):
1005 """If input token contains ASCII non-printables, register a defect."""
1006
1007 non_printables = _non_printable_finder(xtext)
1008 if non_printables:
1009 xtext.defects.append(errors.NonPrintableDefect(non_printables))
1010 if utils._has_surrogates(xtext):
1011 xtext.defects.append(errors.UndecodableBytesDefect(
1012 "Non-ASCII characters found in header token"))
1013
1014def _get_ptext_to_endchars(value, endchars):
1015 """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