Merge lp:~barry/ubuntu/quantal/genshi/lp935516 into lp:ubuntu/quantal/genshi

Proposed by Barry Warsaw
Status: Merged
Merge reported by: Barry Warsaw
Merged at revision: not available
Proposed branch: lp:~barry/ubuntu/quantal/genshi/lp935516
Merge into: lp:ubuntu/quantal/genshi
Diff against target: 98 lines (+56/-2)
5 files modified
debian/changelog (+12/-0)
debian/control (+2/-1)
debian/patches/lp935516.patch (+40/-0)
debian/patches/series (+1/-0)
debian/rules (+1/-1)
To merge this branch: bzr merge lp:~barry/ubuntu/quantal/genshi/lp935516
Reviewer Review Type Date Requested Status
Stefano Rivera Pending
Ubuntu branches Pending
Review via email: mp+127596@code.launchpad.net

Description of the change

I'm not entirely sure I like this patch, although it does fix the FTBFS. The problem I have is that I'm not sure what the semantics of HTMLSanitizer() should be on the bogus SCRIPT tags. Should genshi strip the whole thing? I think upstream will have to decide, and if you follow the links to the upstream tracker issue, there has yet to be any comments.

So without upstream's guidance, perhaps we should just fix the FTBFS now, and watch upstream to apply any patch there once it's available. If nothing's forthcoming until a new version is released, we can resync through Debian for 13.04.

Thoughts?

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-08-23 11:58:39 +0000
+++ debian/changelog 2012-10-02 21:22:20 +0000
@@ -1,3 +1,15 @@
1genshi (0.6-2ubuntu1) quantal; urgency=low
2
3 * genshi/filters/tests/html.py: Adjust some tests which used to fail
4 before changes in upstream Python 2.7.3. These now succeed. While
5 this change is appropriate for the FTBFS in Ubuntu 12.04 which has
6 Python 2.7.3, they may not be appropriate as a general fix, so keep an
7 eye on the upstream bug reports. (LP: #935516)
8 * debian/rules: As suggested in the linked Debian bug, use `set -e` on
9 the test invocation line to force the build to fail when tests fail.
10
11 -- Barry Warsaw <barry@ubuntu.com> Tue, 02 Oct 2012 16:48:23 -0400
12
1genshi (0.6-2) unstable; urgency=low13genshi (0.6-2) unstable; urgency=low
214
3 * Switch to dh_python2. Thanks to Julian Taylor. Closes: #637383.15 * Switch to dh_python2. Thanks to Julian Taylor. Closes: #637383.
416
=== modified file 'debian/control'
--- debian/control 2011-08-23 11:58:39 +0000
+++ debian/control 2012-10-02 21:22:20 +0000
@@ -1,7 +1,8 @@
1Source: genshi1Source: genshi
2Section: python2Section: python
3Priority: optional3Priority: optional
4Maintainer: Arnaud Fontaine <arnau@debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Arnaud Fontaine <arnau@debian.org>
5Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>6Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
6Build-Depends: debhelper (>= 5.0.37.2),7Build-Depends: debhelper (>= 5.0.37.2),
7 cdbs (>= 0.4.90~),8 cdbs (>= 0.4.90~),
89
=== added directory 'debian/patches'
=== added file 'debian/patches/lp935516.patch'
--- debian/patches/lp935516.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/lp935516.patch 2012-10-02 21:22:20 +0000
@@ -0,0 +1,40 @@
1Description: Two tests which used to fail in earlier Pythons, now succeed in
2 Python 2.7.3. Adjust the tests to check for success in order to fix a FTBFS
3 in Ubuntu 12.10.
4Author: Barry Warsaw <barry@ubuntu.com>
5Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/genshi/+bug/935516
6Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661441
7Bug: http://genshi.edgewall.org/ticket/500
8Bug: http://genshi.edgewall.org/ticket/501
9
10--- a/genshi/filters/tests/html.py
11+++ b/genshi/filters/tests/html.py
12@@ -365,9 +365,12 @@
13 self.assertEquals('', (html | HTMLSanitizer()).render())
14 html = HTML('<SCRIPT SRC="http://example.com/"></SCRIPT>')
15 self.assertEquals('', (html | HTMLSanitizer()).render())
16- self.assertRaises(ParseError, HTML, '<SCR\0IPT>alert("foo")</SCR\0IPT>')
17- self.assertRaises(ParseError, HTML,
18- '<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>')
19+ html = HTML('<SCR\0IPT>alert("foo")</SCR\0IPT>')
20+ self.assertEquals('&lt;SCR\x00IPT&gt;alert("foo")',
21+ (html | HTMLSanitizer()).render())
22+ html = HTML('<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>')
23+ self.assertEquals('&lt;SCRIPT&amp;XYZ; SRC="http://example.com/"&gt;',
24+ (html | HTMLSanitizer()).render())
25
26 def test_sanitize_remove_onclick_attr(self):
27 html = HTML('<div onclick=\'alert("foo")\' />')
28@@ -437,9 +440,9 @@
29 # Case-insensitive protocol matching
30 html = HTML('<IMG SRC=\'JaVaScRiPt:alert("foo")\'>')
31 self.assertEquals('<img/>', (html | HTMLSanitizer()).render())
32- # Grave accents (not parsed)
33- self.assertRaises(ParseError, HTML,
34- '<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>')
35+ # Grave accents.
36+ html = HTML('<IMG SRC=`javascript:alert("RSnake says, \'foo\'")`>')
37+ self.assertEquals('<img/>', (html | HTMLSanitizer()).render())
38 # Protocol encoded using UTF-8 numeric entities
39 html = HTML('<IMG SRC=\'&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;'
40 '&#112;&#116;&#58;alert("foo")\'>')
041
=== added file 'debian/patches/series'
--- debian/patches/series 1970-01-01 00:00:00 +0000
+++ debian/patches/series 2012-10-02 21:22:20 +0000
@@ -0,0 +1,1 @@
1lp935516.patch
02
=== modified file 'debian/rules'
--- debian/rules 2011-08-23 11:58:39 +0000
+++ debian/rules 2012-10-02 21:22:20 +0000
@@ -16,7 +16,7 @@
1616
17ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))17ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
18binary-install/python-genshi::18binary-install/python-genshi::
19 for py in $(shell pyversions -vr); do \19 set -e; for py in $(shell pyversions -vr); do \
20 PYTHONPATH=$(cdbs_python_destdir)/usr/lib/python$$py/site-packages \20 PYTHONPATH=$(cdbs_python_destdir)/usr/lib/python$$py/site-packages \
21 python$$py setup.py test; \21 python$$py setup.py test; \
22 done;22 done;

Subscribers

People subscribed via source and target branches

to all changes: