tfix gzip writing - amprolla - devuan's apt repo merger HTML git clone git://parazyd.org/amprolla.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 152f4c434ca99792325707014be3e195a8d9cc88 DIR parent 7b234b5febe9b32148c60a7ff5b5f582e5882d58 HTML Author: parazyd <parazyd@dyne.org> Date: Wed, 31 May 2017 23:18:12 +0200 fix gzip writing Diffstat: M lib/package.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- DIR diff --git a/lib/package.py b/lib/package.py t@@ -11,7 +11,7 @@ def write_packages(packages, filename, sort=True): If sort=True, the packages are sorted by name. """ os.makedirs(os.path.dirname(filename), exist_ok=True) - f = open(filename, 'w+') + f = gzip_open(filename, 'w') pkg_items = packages.items() if sort: t@@ -20,8 +20,9 @@ def write_packages(packages, filename, sort=True): for pkg_name, pkg_contents in pkg_items: for key in packages_keys: if key in pkg_contents: - f.write('%s: %s\n' % (key, pkg_contents[key])) - f.write('\n') + s = '%s: %s\n' % (key, pkg_contents[key]) + f.write(s.encode('utf-8')) + f.write(b'\n') f.close()