(string, encoding, errors)
| 824 | _asciire = re.compile('([\x00-\x7f]+)') |
| 825 | |
| 826 | def _generate_unquoted_parts(string, encoding, errors): |
| 827 | previous_match_end = 0 |
| 828 | for ascii_match in _asciire.finditer(string): |
| 829 | start, end = ascii_match.span() |
| 830 | yield string[previous_match_end:start] # Non-ASCII |
| 831 | # The ascii_match[1] group == string[start:end]. |
| 832 | yield _unquote_impl(ascii_match[1]).decode(encoding, errors) |
| 833 | previous_match_end = end |
| 834 | yield string[previous_match_end:] # Non-ASCII tail |
| 835 | |
| 836 | def unquote(string, encoding='utf-8', errors='replace'): |
| 837 | """Replace %xx escapes by their single-character equivalent. The optional |
no test coverage detected
searching dependent graphs…