[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#856859: unblock: python-tempita/0.5.2-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package python-tempita. This contains a patch backported
from upstream fixing RC bug #750895, in which templates do not work at
all under Python 3 unless an encoding is explicitly specified.

I also fixed Lintian warnings that seemed both potentially serious and
non-intrusive to fix: missing build-arch and build-indep targets (they
just depend on build, which does nothing), and a missing build-dependency
on dh-python (which is in fact pulled in by python3 at the moment,
but I'm not really sure why, particularly as it's a circular dependency).

Sorry for the git-dpm noise in the debdiff, but I thought it was better
to go along with the maintenance team's normal practices than to bypass them.

unblock python-tempita/0.5.2-2

Thanks,
    S
diffstat for python-tempita-0.5.2 python-tempita-0.5.2

 .git-dpm                        |   11 +++++++++
 changelog                       |   21 +++++++++++++++++
 control                         |    6 ++---
 patches/0001-fix-encoding.patch |   47 ++++++++++++++++++++++++++++++++++++++++
 patches/series                  |    1 
 rules                           |    2 +
 tests/control                   |    2 +
 tests/test-installed            |   11 +++++++++
 tests/test.tmpl                 |    2 +
 9 files changed, 100 insertions(+), 3 deletions(-)

diff -Nru python-tempita-0.5.2/debian/changelog python-tempita-0.5.2/debian/changelog
--- python-tempita-0.5.2/debian/changelog	2013-12-17 18:39:56.000000000 +0000
+++ python-tempita-0.5.2/debian/changelog	2017-03-05 15:48:07.000000000 +0000
@@ -1,3 +1,24 @@
+python-tempita (0.5.2-2) unstable; urgency=medium
+
+  * Team upload.
+
+  [ Ondřej Nový ]
+  * Migrate from DPMT svn to DPMT git
+  * Fixed VCS URL (https)
+
+  [ Sascha Steinbiss ]
+  * Address encoding issue on Python 3 by backporting a patch from
+    upstream (Closes: #750895)
+    - Add an autopkgtest
+
+  [ Simon McVittie ]
+  * Correct backported patch to not double-decode strings if an encoding
+    was specified
+  * Add missing build-dependency on dh-python for dh_python3
+  * Add build-arch and build-indep targets to debian/rules
+
+ -- Simon McVittie <smcv@debian.org>  Sun, 05 Mar 2017 15:48:07 +0000
+
 python-tempita (0.5.2-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru python-tempita-0.5.2/debian/control python-tempita-0.5.2/debian/control
--- python-tempita-0.5.2/debian/control	2011-06-14 22:20:36.000000000 +0100
+++ python-tempita-0.5.2/debian/control	2017-03-05 15:48:07.000000000 +0000
@@ -3,14 +3,14 @@
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
 Uploaders: Christoph Haas <haas@debian.org>, Piotr Ożarowski <piotr@debian.org>
-Build-Depends: debhelper (>= 5)
+Build-Depends: debhelper (>= 5), dh-python
 Build-Depends-Indep: python (>= 2.6.6-3), python-setuptools (>= 0.6b3-1~),
  python3, python3-setuptools
 #, python-sphinx
 Standards-Version: 3.9.2
 X-Python-Version: >= 2.5
-Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-tempita/trunk/
-Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-tempita/trunk/
+Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/python-tempita.git
+Vcs-Browser: https://anonscm.debian.org/cgit/python-modules/packages/python-tempita.git
 
 Package: python-tempita
 Architecture: all
diff -Nru python-tempita-0.5.2/debian/.git-dpm python-tempita-0.5.2/debian/.git-dpm
--- python-tempita-0.5.2/debian/.git-dpm	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/.git-dpm	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1,11 @@
+# see git-dpm(1) from git-dpm package
+22312bb50f8fd9692bbb54b237492b32eb30e2dd
+22312bb50f8fd9692bbb54b237492b32eb30e2dd
+0c7ca62c89b183f33da68db9c79b3d7fc365e1c2
+0c7ca62c89b183f33da68db9c79b3d7fc365e1c2
+python-tempita_0.5.2.orig.tar.gz
+8da7851b077af5a540125e3836d9f0f7165eca61
+12648
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff -Nru python-tempita-0.5.2/debian/patches/0001-fix-encoding.patch python-tempita-0.5.2/debian/patches/0001-fix-encoding.patch
--- python-tempita-0.5.2/debian/patches/0001-fix-encoding.patch	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/patches/0001-fix-encoding.patch	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1,47 @@
+From 22312bb50f8fd9692bbb54b237492b32eb30e2dd Mon Sep 17 00:00:00 2001
+From: Sascha Steinbiss <satta@debian.org>
+Date: Sun, 26 Feb 2017 16:55:35 +0000
+Subject: fix encoding
+
+Addresses #750895 by backporting upstream's fix.
+---
+ tempita/__init__.py | 4 +++-
+ tempita/compat3.py  | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/tempita/__init__.py b/tempita/__init__.py
+index 91407b3..031399f 100644
+--- a/tempita/__init__.py
++++ b/tempita/__init__.py
+@@ -37,7 +37,7 @@ import os
+ import tokenize
+ from cStringIO import StringIO
+ from tempita._looper import looper
+-from tempita.compat3 import bytes, basestring_, next, is_unicode, coerce_text
++from tempita.compat3 import PY3, bytes, basestring_, next, is_unicode, coerce_text
+ 
+ __all__ = ['TemplateError', 'Template', 'sub', 'HTMLTemplate',
+            'sub_html', 'html', 'bunch']
+@@ -143,6 +143,8 @@ class Template(object):
+         f.close()
+         if encoding:
+             c = c.decode(encoding)
++        elif PY3:
++            c = c.decode('latin-1')
+         return cls(content=c, name=filename, namespace=namespace,
+                    default_inherit=default_inherit, get_template=get_template)
+ 
+diff --git a/tempita/compat3.py b/tempita/compat3.py
+index 5e18fa0..63098e4 100644
+--- a/tempita/compat3.py
++++ b/tempita/compat3.py
+@@ -1,6 +1,8 @@
+ import sys
+ 
+-__all__ = ['b', 'basestring_', 'bytes', 'next', 'is_unicode']
++__all__ = ['PY3', 'b', 'basestring_', 'bytes', 'next', 'is_unicode']
++
++PY3 = True if sys.version_info[0] == 3 else False
+ 
+ if sys.version < "3":
+     b = bytes = str
diff -Nru python-tempita-0.5.2/debian/patches/series python-tempita-0.5.2/debian/patches/series
--- python-tempita-0.5.2/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/patches/series	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1 @@
+0001-fix-encoding.patch
diff -Nru python-tempita-0.5.2/debian/rules python-tempita-0.5.2/debian/rules
--- python-tempita-0.5.2/debian/rules	2011-06-14 22:19:13.000000000 +0100
+++ python-tempita-0.5.2/debian/rules	2017-03-05 15:48:07.000000000 +0000
@@ -13,6 +13,8 @@
 	dh_clean build-docs
 
 build:
+build-arch: build
+build-indep: build
 
 # build-docs:
 #         dh_testdir
diff -Nru python-tempita-0.5.2/debian/tests/control python-tempita-0.5.2/debian/tests/control
--- python-tempita-0.5.2/debian/tests/control	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/tests/control	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1,2 @@
+Tests: test-installed
+Depends: @
diff -Nru python-tempita-0.5.2/debian/tests/test-installed python-tempita-0.5.2/debian/tests/test-installed
--- python-tempita-0.5.2/debian/tests/test-installed	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/tests/test-installed	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import os
+from tempita import Template as t
+
+tmpldir = os.path.dirname(os.path.realpath(__file__))
+w = t.from_filename(os.path.join(tmpldir, "test.tmpl"))
+print(str(w.substitute()))
+
+w = t.from_filename(os.path.join(tmpldir, "test.tmpl"), encoding='utf-8')
+print(str(w.substitute()))
diff -Nru python-tempita-0.5.2/debian/tests/test.tmpl python-tempita-0.5.2/debian/tests/test.tmpl
--- python-tempita-0.5.2/debian/tests/test.tmpl	1970-01-01 01:00:00.000000000 +0100
+++ python-tempita-0.5.2/debian/tests/test.tmpl	2017-03-05 15:48:07.000000000 +0000
@@ -0,0 +1,2 @@
+{{py:x="Hello"}}
+{{x}} Test

Reply to: