diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b56ef4a..ecce9ac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.0-4] - 2021-02-16 +### Fixed +- Problem using Python 3.6 (ZipFile's compresslevel arg needs 3.7) + ## [0.10.0-3] - 2021-02-16 ### Fixed - Problem using Python 3.6 (StreamHandler.setStream introduced in 3.7) diff --git a/debian/changelog b/debian/changelog index 926262f5..5214ce62 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +kibot (0.10.0-4) stable; urgency=medium + + * Fixed problem using Python 3.6 + (ZipFile's compresslevel argument introduced in 3.7) + + -- Salvador E. Tropea Tue, 16 Feb 2021 12:51:24 -0300 + kibot (0.10.0-3) stable; urgency=medium * Fixed problem using Python 3.6 (#52) diff --git a/kibot/out_compress.py b/kibot/out_compress.py index 1900e474..f1cd016d 100644 --- a/kibot/out_compress.py +++ b/kibot/out_compress.py @@ -6,6 +6,7 @@ import re import os import glob +import sys from sys import exit from subprocess import check_output, STDOUT, CalledProcessError from zipfile import ZipFile, ZIP_STORED, ZIP_DEFLATED, ZIP_BZIP2, ZIP_LZMA @@ -68,7 +69,11 @@ class CompressOptions(BaseOptions): logger.warning(W_EMPTYZIP+'No files provided, creating an empty archive') def create_zip(self, output, files): - with ZipFile(output, 'w', compression=self.ZIP_ALGORITHMS[self.compression], compresslevel=9) as zip: + extra = {} + extra['compression'] = self.ZIP_ALGORITHMS[self.compression] + if sys.version_info.major > 3 or (sys.version_info.major == 3 and sys.version_info.minor >= 7): + extra['compresslevel'] = 9 + with ZipFile(output, 'w', **extra) as zip: for fname, dest in files.items(): logger.debug('Adding '+fname+' as '+dest) zip.write(fname, dest)