[Python-modules-commits] r23045 - in packages/genshi/trunk/debian (5 files)

arnau at users.alioth.debian.org arnau at users.alioth.debian.org
Sat Nov 24 05:39:41 UTC 2012


    Date: Saturday, November 24, 2012 @ 05:39:37
  Author: arnau
Revision: 23045

Fix tests which used to fail with python < 2.7.3. Thanks to Barry Warsaw. Closes: #661441.

Added:
  packages/genshi/trunk/debian/patches/
  packages/genshi/trunk/debian/patches/fix_tests_failure_with_python27.patch
  packages/genshi/trunk/debian/patches/series
Modified:
  packages/genshi/trunk/debian/changelog
  packages/genshi/trunk/debian/rules

Modified: packages/genshi/trunk/debian/changelog
===================================================================
--- packages/genshi/trunk/debian/changelog	2012-11-23 18:23:15 UTC (rev 23044)
+++ packages/genshi/trunk/debian/changelog	2012-11-24 05:39:37 UTC (rev 23045)
@@ -1,8 +1,11 @@
-genshi (0.6-3) UNRELEASED; urgency=low
+genshi (0.6-3) unstable; urgency=low
 
   * debian/rules: build should fail if tests fail.
+  * debian/patches/fix_tests_failure_with_python27.patch:
+    + Fix tests which used to fail with python < 2.7.3. Thanks to Barry Warsaw.
+      Closes: #661441.
 
- -- Arnaud Fontaine <arnau at debian.org>  Wed, 26 Sep 2012 09:13:14 +0900
+ -- Arnaud Fontaine <arnau at debian.org>  Sat, 24 Nov 2012 11:38:21 +0900
 
 genshi (0.6-2) unstable; urgency=low
 

Added: packages/genshi/trunk/debian/patches/fix_tests_failure_with_python27.patch
===================================================================
--- packages/genshi/trunk/debian/patches/fix_tests_failure_with_python27.patch	                        (rev 0)
+++ packages/genshi/trunk/debian/patches/fix_tests_failure_with_python27.patch	2012-11-24 05:39:37 UTC (rev 23045)
@@ -0,0 +1,58 @@
+Description: Two tests which used to fail in earlier Pythons, now succeed in
+ Python 2.7.3.  Adjust the tests to check for success in order to fix a FTBFS
+ in Ubuntu 12.10.
+Author: Barry Warsaw <barry at ubuntu.com>, Arnaud Fontaine <arnau at debian.org>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/genshi/+bug/935516
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661441
+Bug: http://genshi.edgewall.org/ticket/500
+Bug: http://genshi.edgewall.org/ticket/501
+
+Index: genshi-0.6/genshi/filters/tests/html.py
+===================================================================
+--- genshi-0.6.orig/genshi/filters/tests/html.py	2010-04-22 21:09:52.000000000 +0900
++++ genshi-0.6/genshi/filters/tests/html.py	2012-11-24 14:35:02.116021695 +0900
+@@ -365,9 +365,24 @@
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+         html = HTML('<SCRIPT SRC="http://example.com/"></SCRIPT>')
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+-        self.assertRaises(ParseError, HTML, '<SCR\0IPT>alert("foo")</SCR\0IPT>')
+-        self.assertRaises(ParseError, HTML,
+-                          '<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>')
++
++        # Before Python 2.7.3, HTMLParser() raises a ParseError
++        try:
++            html = HTML('<SCR\0IPT>alert("foo")</SCR\0IPT>')
++        except ParseError:
++            pass
++        else:
++            self.assertEquals('<SCR\x00IPT>alert("foo")',
++                              (html | HTMLSanitizer()).render())
++
++        # Before Python 2.7.3, HTMLParser() raises a ParseError
++        try:
++            html = HTML('<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>')
++        except ParseError:
++            pass
++        else:
++            self.assertEquals('<SCRIPT&XYZ; SRC="http://example.com/">',
++                              (html | HTMLSanitizer()).render())
+ 
+     def test_sanitize_remove_onclick_attr(self):
+         html = HTML('<div onclick=\'alert("foo")\' />')
+@@ -437,9 +452,13 @@
+         # Case-insensitive protocol matching
+         html = HTML('<IMG SRC=\'JaVaScRiPt:alert("foo")\'>')
+         self.assertEquals('<img/>', (html | HTMLSanitizer()).render())
+-        # Grave accents (not parsed)
+-        self.assertRaises(ParseError, HTML,
+-                          '<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>')
++        # Grave accents. Before Python 2.7.3, HTMLParser() raises a ParseError
++        try:
++            html = HTML('<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>')
++        except ParseError:
++            pass
++        else:
++            self.assertEquals('<img/>', (html | HTMLSanitizer()).render())
+         # Protocol encoded using UTF-8 numeric entities
+         html = HTML('<IMG SRC=\'javascri'
+                     'pt:alert("foo")\'>')

Added: packages/genshi/trunk/debian/patches/series
===================================================================
--- packages/genshi/trunk/debian/patches/series	                        (rev 0)
+++ packages/genshi/trunk/debian/patches/series	2012-11-24 05:39:37 UTC (rev 23045)
@@ -0,0 +1 @@
+fix_tests_failure_with_python27.patch

Modified: packages/genshi/trunk/debian/rules
===================================================================
--- packages/genshi/trunk/debian/rules	2012-11-23 18:23:15 UTC (rev 23044)
+++ packages/genshi/trunk/debian/rules	2012-11-24 05:39:37 UTC (rev 23045)
@@ -16,7 +16,7 @@
 
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 binary-install/python-genshi::
-	set -e; for py in $(shell pyversions -vr); do \
+	set -ex; for py in $(shell pyversions -vr); do \
 		PYTHONPATH=$(cdbs_python_destdir)/usr/lib/python$$py/site-packages \
 			python$$py setup.py test; \
 	done;




More information about the Python-modules-commits mailing list