From f64f7072c0e6ebef33222feb4adb2779dd7bcb75 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 26 Apr 2015 18:20:10 +0200 Subject: [PATCH] Sources and Packages are utf-8 Signed-off-by: Julien Cristau --- britney.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index 791ee4a..8945e0c 100755 --- a/britney.py +++ b/britney.py @@ -509,7 +509,8 @@ class Britney(object): filename = os.path.join(basedir, "Sources") self.__log("Loading source packages from %s" % filename) - Packages = apt_pkg.TagFile(open(filename)) + with open(filename, encoding='utf-8') as f: + Packages = apt_pkg.TagFile(f) get_field = Packages.section.get step = Packages.step @@ -564,7 +565,8 @@ class Britney(object): filename = os.path.join(basedir, "Packages_%s" % arch) self.__log("Loading binary packages from %s" % filename) - Packages = apt_pkg.TagFile(open(filename)) + with open(filename, encoding='utf-8') as f: + Packages = apt_pkg.TagFile(f) get_field = Packages.section.get step = Packages.step