summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-01-17 13:22:34 +0100
committerJulian Andres Klode <jak@debian.org>2010-01-17 13:22:34 +0100
commit773c5de21c809c7fe07eefafa252efa0b6758744 (patch)
tree2e3344e061a7ab275437c2b4fcf50898ae811b75
parent875d039bdfa15a02968ab8188584fae790a92d5f (diff)
downloadpython-apt-773c5de21c809c7fe07eefafa252efa0b6758744.tar.gz
aptsources/distro.py: Support Python 3, decode lsb_release results using utf-8.
-rw-r--r--aptsources/distro.py2
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 0 deletions
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: