Commits

Anonymous committed 74cf20a

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.
........

Comments (0)

Files changed (2)

             n = int(name)
         except ValueError:
             return
-        if not 0 <= n <= 255:
+        if not 0 <= n <= 127:
             return
         return self.convert_codepoint(n)
 

Lib/test/test_sgmllib.py

             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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.