mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
#2834: Change re module semantics, so that str and bytes mixing is forbidden,
and str (unicode) patterns get full unicode matching by default. The re.ASCII flag is also introduced to ask for ASCII matching instead.
This commit is contained in:
parent
3ad7ba10a2
commit
fd036451bf
37 changed files with 280 additions and 163 deletions
|
|
@ -385,4 +385,4 @@ class HTMLParser(_markupbase.ParserBase):
|
|||
return '&'+s+';'
|
||||
|
||||
return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));",
|
||||
replaceEntities, s)
|
||||
replaceEntities, s, re.ASCII)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue