[Checkins] SVN: zope.tal/trunk/src/zope/tal/tests/test_talinterpreter.py Towards Py3K: &#45 inside attribute values

Marius Gedminas cvs-admin at zope.org
Thu Feb 7 23:05:08 UTC 2013


Log message for revision 129198:
  Towards Py3K: &#45 inside attribute values
  
  I've no idea why this case is handled differently on Python 2 and Python 3.
  
  There's precedent for different escaping on different Python versions:
  before 2.6 and since 2.6.  Speaking of which, let's drop the "before
  2.6" case.

Changed:
  U   zope.tal/trunk/src/zope/tal/tests/test_talinterpreter.py

-=-
Modified: zope.tal/trunk/src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- zope.tal/trunk/src/zope/tal/tests/test_talinterpreter.py	2013-02-07 23:05:05 UTC (rev 129197)
+++ zope.tal/trunk/src/zope/tal/tests/test_talinterpreter.py	2013-02-07 23:05:07 UTC (rev 129198)
@@ -708,16 +708,18 @@
         self.compare(INPUT, EXPECTED)
 
     def test_entities(self):
-        if sys.version_info < (2, 6):
+        if sys.version_info < (3, 0):
             INPUT = ('<img tal:define="foo nothing" '
-                    'alt="&a; &#1; &#x0a; &a &#45 &; &#0a; <>" />')
-            EXPECTED = ('<img alt="&a; &#1; &#x0a; '
-                        '&amp;a &amp;#45 &amp;; &amp;#0a; &lt;&gt;" />')
+                    'alt="&a; &#1; &#x0a; &a &#45 &; <>" />')
+            EXPECTED = ('<img alt="&a; \x01 \n '
+                        '&amp;a &amp;#45 &amp;; &lt;&gt;" />')
         else:
+            # XXX: why does &#45 with no terminating ; become a - on
+            # Python 3.3 and is that acceptable or a regression?
             INPUT = ('<img tal:define="foo nothing" '
                     'alt="&a; &#1; &#x0a; &a &#45 &; <>" />')
             EXPECTED = ('<img alt="&a; \x01 \n '
-                        '&amp;a &amp;#45 &amp;; &lt;&gt;" />')
+                        '&amp;a - &amp;; &lt;&gt;" />')
         self.compare(INPUT, EXPECTED)
 
     def compare(self, INPUT, EXPECTED):



More information about the checkins mailing list