mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
This commit is contained in:
parent
a391b11320
commit
8f36af7a4c
32 changed files with 84 additions and 79 deletions
|
@ -791,7 +791,7 @@ def parse_template(source, pattern):
|
|||
else:
|
||||
# The tokenizer implicitly decodes bytes objects as latin-1, we must
|
||||
# therefore re-encode the final representation.
|
||||
encode = lambda x: x.encode('latin1')
|
||||
encode = lambda x: x.encode('latin-1')
|
||||
for c, s in p:
|
||||
if c is MARK:
|
||||
groupsappend((i, s))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue