Source: jinja2
Version: 2.7-2
Severity: grave
Justification: renders package (mostly) unusable
Tags: patch

jinja2_2.7-1 dropped support for Python 3.2, but this still the default version of Python 3. This breaks python3-sphinx, and makes at least 4 packages that build-depend on it FTBFS.

As I understand it, the only 3.3-specific feature jinja2 uses is u'' literals. Fortunately, you can convert from u'' back to '' by using 2to3 cleverly. Patch attached.

--
Jakub Wilk
diff -Nru jinja2-2.7/debian/changelog jinja2-2.7/debian/changelog
--- jinja2-2.7/debian/changelog	2013-05-23 18:44:24.000000000 +0200
+++ jinja2-2.7/debian/changelog	2013-05-24 16:42:51.000000000 +0200
@@ -1,3 +1,9 @@
+jinja2 (2.7-3) UNRELEASED; urgency=low
+
+  * Restore Python 3.2 compatibility.
+
+ -- Jakub Wilk <[email protected]>  Fri, 24 May 2013 16:42:43 +0200
+
 jinja2 (2.7-2) unstable; urgency=low
 
   * Relax build dependency on python3-all and hardcode python3-jinja2's
diff -Nru jinja2-2.7/debian/control jinja2-2.7/debian/control
--- jinja2-2.7/debian/control	2013-05-23 18:39:49.000000000 +0200
+++ jinja2-2.7/debian/control	2013-05-24 17:13:42.000000000 +0200
@@ -10,7 +10,7 @@
 Standards-Version: 3.9.4
 Homepage: http://jinja.pocoo.org/2/
 X-Python-Version: >= 2.6
-X-Python3-Version: >= 3.3
+X-Python3-Version: >= 3.2
 Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/jinja2/trunk/
 Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/jinja2/trunk/
 
@@ -53,7 +53,7 @@
 
 Package: python3-jinja2
 Architecture: all
-Depends: python3 (>= 3.3) | python3.3, ${misc:Depends}, python3-markupsafe
+Depends: ${python3:Depends}, ${misc:Depends}, python3-markupsafe
 Recommends: python3-pkg-resources
 Provides: ${python3:Provides}
 Suggests: python-jinja2-doc
diff -Nru jinja2-2.7/debian/python3-jinja2.postinst jinja2-2.7/debian/python3-jinja2.postinst
--- jinja2-2.7/debian/python3-jinja2.postinst	2013-05-23 18:48:24.000000000 +0200
+++ jinja2-2.7/debian/python3-jinja2.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +0,0 @@
-#!/bin/sh
-set -e
-
-if which py3compile >/dev/null 2>&1; then
-	py3compile -p python3-jinja2 -V 3.3-
-fi
diff -Nru jinja2-2.7/debian/rules jinja2-2.7/debian/rules
--- jinja2-2.7/debian/rules	2013-05-23 18:40:05.000000000 +0200
+++ jinja2-2.7/debian/rules	2013-05-24 17:27:26.000000000 +0200
@@ -26,6 +26,11 @@
 build-indep: $(PYVERS:%=build-python%) build-docs
 	touch $@
 
+build-python3%:
+	python3$* setup.py build
+	python debian/u2to3.py --no-diffs --write --nobackups build/lib/
+	touch $@
+
 build-python%:
 	python$* setup.py build
 	touch $@
diff -Nru jinja2-2.7/debian/u2to3.py jinja2-2.7/debian/u2to3.py
--- jinja2-2.7/debian/u2to3.py	1970-01-01 01:00:00.000000000 +0100
+++ jinja2-2.7/debian/u2to3.py	2013-05-24 17:32:25.000000000 +0200
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+'''
+minimal 2to3 coverter that touches only u'' literals
+'''
+
+import sys
+from lib2to3.fixes.fix_unicode import FixUnicode
+
+FixUnicode.PATTERN = 'STRING'
+sys.argv[1:1] = ['-f', 'unicode']
+execfile('/usr/bin/2to3')

Reply via email to