[New-bugs-announce] [issue2927] expose html.parser.unescape

Tom Pinckney report at bugs.python.org
Tue May 20 07:43:55 CEST 2008

New submission from Tom Pinckney <thomaspinckney3 at gmail.com>:

There is currently a private method inside of html.parser.HTMLParser to 
unescape HTML &...; style escapes. This would be useful to expose for 
other users who want to unescape a piece of HTML.

Additionally, many websites don't use proper unicode or iso-8859-1 
encodings and accidentally use Microsoft Code Page 1252 extensions. I 
added code to map these to their appropriate unicode values.

The unescaping logic was slightly simplified too.

This is my first Python patch submission, so please let me know if I've 
done anything wrong.

A new test case was also added for this functionality.

components: Library (Lib)
files: unescape.diff
keywords: patch
messages: 67102
nosy: thomaspinckney3
severity: normal
status: open
title: expose html.parser.unescape
type: feature request
versions: Python 2.6
Added file: http://bugs.python.org/file10383/unescape.diff

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list