-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Zope Tests Summarizer wrote:

> Test failures
> -------------
> 
> Subject: FAILED (errors=1) : Zope-trunk-alltests Python-2.6.1 : Linux
> From: Zope Tests
> Date: Mon Apr  6 21:02:44 EDT 2009
> URL: http://mail.zope.org/pipermail/zope-tests/2009-April/011410.html

This failure is due to a changed (less tolerant) HTMLParser module in
Python 2.6.  The new module barfs on invalid quasi-numeric entities
('&#0a' in our example, which is missing the 'X' to make it valid).

Even if I delete the broken case, the test fails again because the 2.6
parser also converts the numeric entities to unicode, injecting Ctrl-A
and LF for '' and '&X0a;'!

I'm not sure how we should attempt to fix the test, except for a "big
hammer" check of sys.version_info and two different inputs / expected
outputs.  If nobody has a better idea, I will check that in tomorrow
(see attached patch).


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tsea...@palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ206/+gerLs4ltQ4RAqpkAKDGS2c66egb0sO3VTUiUlU0LLpp2QCfcf0H
Q8HnrOKqduKjuHIiMPlwbUc=
=Vwvg
-----END PGP SIGNATURE-----
Index: src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- src/zope/tal/tests/test_talinterpreter.py	(revision 98974)
+++ src/zope/tal/tests/test_talinterpreter.py	(working copy)
@@ -706,10 +706,16 @@
         self.compare(INPUT, EXPECTED)
 
     def test_entities(self):
-        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;" />')
+        if sys.version_info < (2, 6):
+            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;" />')
+        else:
+            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;" />')
         self.compare(INPUT, EXPECTED)
 
     def compare(self, INPUT, EXPECTED):
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to