From c74dc171bf03d27ffb77f150f144cac47cd3f8f5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 21 Jun 2015 12:52:45 +0200 Subject: fix py3 issue with auto .gz decompression and add test --- apt/debfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt') diff --git a/apt/debfile.py b/apt/debfile.py index e9be9672..3f4bca4b 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -27,7 +27,7 @@ import os import sys from apt_pkg import gettext as _ -from io import StringIO +from io import BytesIO class NoDebArchiveException(IOError): @@ -637,9 +637,9 @@ class DebPackage(object): data = part.extractdata(name) # check for zip content if name.endswith(".gz") and auto_decompress: - io = StringIO(data) + io = BytesIO(data) gz = gzip.GzipFile(fileobj=io) - data = _("Automatically decompressed:\n\n") + data = _("Automatically decompressed:\n\n").encode("utf-8") data += gz.read() # auto-convert to hex try: -- cgit v1.2.3