Work around Debian bug#561805 (closes #86030)

debian.changelog.Changelog doesn't deal well with unicode, so make sure we don't set the distributions list to a unicode string.

authorJulien Cristau <julien.cristau@logilab.fr>
changeset609efcd35a73
branchdefault
phasepublic
hiddenno
parent revision#f2c67079bdfb lgp: disable hooks that slow down build process uselessly
child revision#5f6beb5963cc add missing future imports
files modified by this revision
lgp/setupinfo.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1324300194 -3600
# Mon Dec 19 14:09:54 2011 +0100
# Node ID 609efcd35a73202c28b6c56e3222e576844c08cd
# Parent f2c67079bdfb8855feedf89bc10037193d83bd96
Work around Debian bug#561805 (closes #86030)

debian.changelog.Changelog doesn't deal well with unicode, so make sure
we don't set the distributions list to a unicode string.

diff --git a/lgp/setupinfo.py b/lgp/setupinfo.py
@@ -450,11 +450,12 @@
1          from debian.changelog import Changelog
2          debchangelog = osp.join(self.origpath, 'debian', 'changelog')
3          changelog = Changelog(open(debchangelog))
4          # substitute distribution string in changelog
5          if distrib:
6 -            changelog.distributions = distrib
7 +            # squeeze python-debian doesn't handle unicode well, see Debian bug#561805
8 +            changelog.distributions = str(distrib)
9          # append suffix string (or timestamp if suffix is empty) to debian revision
10          if self.config.suffix is not None:
11              suffix = self.config.suffix or '+%s' % int(time.time())
12              self.logger.debug("suffix '%s' added to package version" % suffix)
13              changelog.version = str(changelog.version) + suffix