Kaydet (Commit) ee13a2ec authored tarafından Matthias Klose's avatar Matthias Klose

Merged revisions 70906 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70906 | georg.brandl | 2009-04-01 00:11:53 +0200 (Mi, 01 Apr 2009) | 1 line

  #1651995: fix _convert_ref for non-ASCII characters.
........
üst c9da90a7
......@@ -396,7 +396,7 @@ class SGMLParser(markupbase.ParserBase):
n = int(name)
except ValueError:
return
if not 0 <= n <= 255:
if not 0 <= n <= 127:
return
return self.convert_codepoint(n)
......
......@@ -373,6 +373,15 @@ DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN'
if len(data) != CHUNK:
break
def test_only_decode_ascii(self):
# SF bug #1651995, make sure non-ascii character references are not decoded
s = '<signs exclamation="&#33" copyright="&#169" quoteleft="&#8216;">'
self.check_events(s, [
('starttag', 'signs',
[('exclamation', '!'), ('copyright', '&#169'),
('quoteleft', '&#8216;')]),
])
# XXX These tests have been disabled by prefixing their names with
# an underscore. The first two exercise outstanding bugs in the
# sgmllib module, and the third exhibits questionable behavior
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment