File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -458,4 +458,4 @@ def replaceEntities(s):
458458 return '&' + s + ';'
459459
460460 return re .sub (r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));" ,
461- replaceEntities , s , re .ASCII )
461+ replaceEntities , s , flags = re .ASCII )
Original file line number Diff line number Diff line change @@ -377,7 +377,8 @@ def test_unescape_function(self):
377377 p = html .parser .HTMLParser ()
378378 self .assertEqual (p .unescape ('&#bad;' ),'&#bad;' )
379379 self .assertEqual (p .unescape ('&' ),'&' )
380-
380+ # see #12888
381+ self .assertEqual (p .unescape ('{ ' * 1050 ), '{ ' * 1050 )
381382
382383def test_main ():
383384 support .run_unittest (HTMLParserTestCase , HTMLParserTolerantTestCase )
Original file line number Diff line number Diff line change @@ -661,6 +661,7 @@ Douglas Orr
661661Michele Orrù
662662Oleg Oshmyan
663663Denis S. Otkidach
664+ Peter Otten
664665Michael Otteneder
665666R. M. Oudkerk
666667Russel Owen
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ Core and Builtins
2525Library
2626-------
2727
28+ - Issue #12888: Fix a bug in HTMLParser.unescape that prevented it to escape
29+ more than 128 entities. Patch by Peter Otten.
30+
2831- Issue #12878: Expose a __dict__ attribute on io.IOBase and its subclasses.
2932
3033- Issue #12636: IDLE reads the coding cookie when executing a Python script.
You can’t perform that action at this time.
0 commit comments