From 773c5de21c809c7fe07eefafa252efa0b6758744 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 17 Jan 2010 13:22:34 +0100 Subject: aptsources/distro.py: Support Python 3, decode lsb_release results using utf-8. --- aptsources/distro.py | 2 ++ debian/changelog | 1 + 2 files changed, 3 insertions(+) diff --git a/aptsources/distro.py b/aptsources/distro.py index 5a6301bd..ff1bed89 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -446,6 +446,8 @@ def _lsb_release(): 'Release': 'unstable'} try: out = Popen(['lsb_release', '--all'], stdout=PIPE).communicate()[0] + # Convert to unicode string, needed for Python 3.1 + out = out.decode("utf-8") result.update(l.split(":\t") for l in out.split("\n") if ':\t' in l) except OSError, exc: if exc.errno != errno.ENOENT: diff --git a/debian/changelog b/debian/changelog index b955b155..646b9efe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ python-apt (0.7.93) UNRELEASED; urgency=low build-time dependency. * aptsources: - Make all classes subclasses of object. + - distro.py: Support Python 3, decode lsb_release results using utf-8. [ Colin Watson ] * apt/progress/__init__.py: -- cgit v1.2.3