(string, encoding, errors)
| 704 | _asciire = re.compile('([\x00-\x7f]+)') |
| 705 | |
| 706 | def _generate_unquoted_parts(string, encoding, errors): |
| 707 | previous_match_end = 0 |
| 708 | for ascii_match in _asciire.finditer(string): |
| 709 | start, end = ascii_match.span() |
| 710 | yield string[previous_match_end:start] # Non-ASCII |
| 711 | # The ascii_match[1] group == string[start:end]. |
| 712 | yield _unquote_impl(ascii_match[1]).decode(encoding, errors) |
| 713 | previous_match_end = end |
| 714 | yield string[previous_match_end:] # Non-ASCII tail |
| 715 | |
| 716 | def unquote(string, encoding='utf-8', errors='replace'): |
| 717 | """Replace %xx escapes by their single-character equivalent. The optional |
no test coverage detected