If input token contains ASCII non-printables, register a defect.
(xtext)
| 1002 | re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match |
| 1003 | |
| 1004 | def _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 | |
| 1014 | def _get_ptext_to_endchars(value, endchars): |
| 1015 | """Scan printables/quoted-pairs until endchars and return unquoted ptext. |
no test coverage detected