You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
html.parser.HTMLParser.unescape works only with the first 128 entities #57097
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ezio-melotti'closed_at=<Date2011-09-05.14:26:55.245>created_at=<Date2011-09-02.21:08:40.271>labels= ['type-bug', 'library']
title='html.parser.HTMLParser.unescape works only with the first 128 entities'updated_at=<Date2011-09-05.14:26:55.242>user='https://bugs.python.org/yveszioupcom'
New changeset 9896fc2a8167 by Ezio Melotti in branch '3.2': bpo-12888: Fix a bug in HTMLParser.unescape that prevented it to escape more than 128 entities. Patch by Peter Otten. http://hg.python.org/cpython/rev/9896fc2a8167
Activity
yveszioupcom commentedon Sep 2, 2011
html.parser.HTMLParser.unescape works only with the first 128 entities, it leaves the other ones as they are.
yveszioupcom commentedon Sep 3, 2011
Added a test case:
http://hg.zioup.org/cpython/rev/4accd3181061
If you set the loop < 128 then the test passes (set at 1000 right now).
peterotten commentedon Sep 3, 2011
The unescape() method uses re.sub(regex, sub, re.ASCII), but the third argument is count, not flags. Fix is easy: use
re.sub(regex, sub, flags=re.ASCII).
python-dev commentedon Sep 5, 2011
New changeset 9896fc2a8167 by Ezio Melotti in branch '3.2':
bpo-12888: Fix a bug in HTMLParser.unescape that prevented it to escape more than 128 entities. Patch by Peter Otten.
http://hg.python.org/cpython/rev/9896fc2a8167
New changeset 7b6096852665 by Ezio Melotti in branch 'default':
bpo-12888: merge with 3.2.
http://hg.python.org/cpython/rev/7b6096852665
ezio-melotti commentedon Sep 5, 2011
Fixed, thanks for the report and the patch!