diff options
| author | Michael Vogt <mvo@debian.org> | 2015-06-21 12:52:45 +0200 |
|---|---|---|
| committer | Michael Vogt <mvo@debian.org> | 2015-06-21 13:01:21 +0200 |
| commit | c74dc171bf03d27ffb77f150f144cac47cd3f8f5 (patch) | |
| tree | b223585861eb9d381e21df96a74ad2c8284ed40c /apt | |
| parent | cb57a52242a6da1b1791e63791f1b9cd50518829 (diff) | |
| download | python-apt-c74dc171bf03d27ffb77f150f144cac47cd3f8f5.tar.gz | |
fix py3 issue with auto .gz decompression and add test
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/debfile.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |
