summaryrefslogtreecommitdiffstats
path: root/Lib/sgmllib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2006-06-23 06:03:45 (GMT)
committerFred Drake <fdrake@acm.org>2006-06-23 06:03:45 (GMT)
commit2f99da636b3c809977405ee6220ad7ea822d7dd3 (patch)
treed7851b84f47360d17ee4882b9b88e33a98a85669 /Lib/sgmllib.py
parentb114984225c0371a21ce44e037abb452e36e2a6d (diff)
downloadcpython-2f99da636b3c809977405ee6220ad7ea822d7dd3.zip
cpython-2f99da636b3c809977405ee6220ad7ea822d7dd3.tar.gz
cpython-2f99da636b3c809977405ee6220ad7ea822d7dd3.tar.bz2
- SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values) - cleaned up tests of character and entity reference decoding so the tests cover the documented relationships among handle_charref, handle_entityref, convert_charref, convert_codepoint, and convert_entityref, without bringing up Unicode issues that sgmllib cannot be involved in
Diffstat (limited to 'Lib/sgmllib.py')
-rw-r--r--Lib/sgmllib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py
index 194396b..3ab57c2 100644
--- a/Lib/sgmllib.py
+++ b/Lib/sgmllib.py
@@ -33,7 +33,7 @@ endbracket = re.compile('[<>]')
tagfind = re.compile('[a-zA-Z][-_.a-zA-Z0-9]*')
attrfind = re.compile(
r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
- r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*))?')
+ r'(\'[^\']*\'|"[^"]*"|[][\-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*))?')
class SGMLParseError(RuntimeError):
@@ -400,11 +400,11 @@ class SGMLParser(markupbase.ParserBase):
def handle_charref(self, name):
"""Handle character reference, no need to override."""
- replacement = convert_charref(name)
+ replacement = self.convert_charref(name)
if replacement is None:
self.unknown_charref(name)
else:
- self.handle_data(convert_charref(name))
+ self.handle_data(replacement)
# Definition of entities -- derived classes may override
entitydefs = \