Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ version 1.8.1-dev
+ Fix a crash on macOS and PyPy when there is not enough memory to create the
internal lock of an ``isal_zlib.Compress``, ``isal_zlib.Decompress``, or
``igzip_lib.IgzipDecompressor`` object. It raises ``MemoryError`` now.
+ Fix the ``-0`` and ``--fast`` options of ``python -m isal.igzip``, which
compressed at level 2 instead of level 0.

version 1.8.0
-----------------
Expand Down
5 changes: 3 additions & 2 deletions src/isal/igzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ def _argument_parser():
"-3", "--best", action="store_const", dest="compresslevel",
const=_COMPRESS_LEVEL_BEST,
help="use compression level 3 (best)")
compress_group.set_defaults(compress=True)
compress_group.set_defaults(compress=True,
compresslevel=_COMPRESS_LEVEL_TRADEOFF)
compress_group.add_argument(
"-d", "--decompress", action="store_const",
dest="compress",
Expand Down Expand Up @@ -333,7 +334,7 @@ def main():
import shutil # Only the command line interface needs it
args = _argument_parser().parse_args()

compresslevel = args.compresslevel or _COMPRESS_LEVEL_TRADEOFF
compresslevel = args.compresslevel

if args.output:
out_filepath = args.output
Expand Down
2 changes: 2 additions & 0 deletions tests/test_igzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def test_compress_stdin_stdout(monkeypatch, capsysbinary, level):
out, err = capsysbinary.readouterr()
assert err == b''
assert gzip.decompress(out) == DATA
# The XFL byte of the gzip header is 4 only at the fastest level.
assert out[8] == (4 if level == "0" else 0)


def test_decompress_infile_outfile(monkeypatch, tmp_path, capsysbinary):
Expand Down
Loading