diff Lib/html/parser.py @ 48769:83b2d07b475b

#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.
author Antoine Pitrou <solipsis@pitrou.net>
date Tue, 19 Aug 2008 17:56:33 +0000
parents 7aa9ad658014
children bf04eaf1af74
line wrap: on
line diff
--- a/Lib/html/parser.py	Tue Aug 19 17:16:56 2008 +0000
+++ b/Lib/html/parser.py	Tue Aug 19 17:56:33 2008 +0000
@@ -385,4 +385,4 @@
                     return '&'+s+';'
 
         return re.sub(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));",
-                      replaceEntities, s)
+                      replaceEntities, s, re.ASCII)