[Python-checkins] r71145 - in python/branches/release26-maint: Lib/sgmllib.py Lib/test/test_sgmllib.py

matthias.klose python-checkins at python.org
Sat Apr 4 14:51:52 CEST 2009


Author: matthias.klose
Date: Sat Apr  4 14:51:52 2009
New Revision: 71145

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


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Lib/sgmllib.py
   python/branches/release26-maint/Lib/test/test_sgmllib.py

Modified: python/branches/release26-maint/Lib/sgmllib.py
==============================================================================
--- python/branches/release26-maint/Lib/sgmllib.py	(original)
+++ python/branches/release26-maint/Lib/sgmllib.py	Sat Apr  4 14:51:52 2009
@@ -396,7 +396,7 @@
             n = int(name)
         except ValueError:
             return
-        if not 0 <= n <= 255:
+        if not 0 <= n <= 127:
             return
         return self.convert_codepoint(n)
 

Modified: python/branches/release26-maint/Lib/test/test_sgmllib.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_sgmllib.py	(original)
+++ python/branches/release26-maint/Lib/test/test_sgmllib.py	Sat Apr  4 14:51:52 2009
@@ -373,6 +373,15 @@
             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


More information about the Python-checkins mailing list