Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
8dc82da
Fix reported memory errors in asan environment by using the debugging…
rhpvorderman Apr 17, 2026
093cb81
Update macos labels
rhpvorderman Apr 17, 2026
d99d49b
Re-enable PyPy wheel builds
msto May 20, 2026
d634271
Merge pull request #249 from pycompression/memoryissues
rhpvorderman Jul 20, 2026
1cab52c
Merge branch 'develop' into ci/enable-pypy-wheels
rhpvorderman Jul 20, 2026
73d4e9f
Merge pull request #251 from msto/ci/enable-pypy-wheels
rhpvorderman Jul 20, 2026
dff90d1
Fix zlib headers for preset dictionary compression
glinkinvd Sep 29, 2026
1178365
Discard compressed input buffer on backward gzip seek
glinkinvd Sep 29, 2026
6b068b8
Merge pull request #257 from glinkinvd/fix-zlib-dictionary-header
rhpvorderman Oct 13, 2026
9748bda
Merge branch 'develop' into fix-gzip-backward-seek
rhpvorderman Oct 13, 2026
b6f1258
Merge pull request #258 from glinkinvd/fix-gzip-backward-seek
rhpvorderman Oct 13, 2026
f19767a
Update python versions (#259)
rhpvorderman Oct 13, 2026
262b296
Update ISA-L to 2.32.1
rhpvorderman Oct 13, 2026
59b8598
Merge pull request #260 from pycompression/issue253
rhpvorderman Oct 13, 2026
31798c5
Create test for adverserial input
rhpvorderman Oct 13, 2026
3cda8e6
Throw an overflow on big headers
rhpvorderman Oct 13, 2026
93a14ab
Fix permission error in test
rhpvorderman Oct 13, 2026
ea827a7
Update comment
rhpvorderman Oct 13, 2026
3d561a5
Update changelog
rhpvorderman Oct 13, 2026
9bcd965
Merge pull request #262 from pycompression/issue250
rhpvorderman Oct 13, 2026
8c35b7d
Fix a crash when _GzipReader gets an object that is not bytes-like
ptweezy Oct 15, 2026
c79b10b
Keep a reference to the zdict of IgzipDecompressor
ptweezy Oct 15, 2026
aeb5dae
Release the lock when Compress.flush gets an unsupported mode
ptweezy Oct 15, 2026
f57d39b
Fix a double free when a level 0 Compress is finished twice
ptweezy Oct 15, 2026
e88a3fe
Fix unused_data when max_length splits the end of a stream
ptweezy Oct 15, 2026
cd5e266
Raise argument errors from _ParallelCompress instead of SystemError
ptweezy Oct 15, 2026
b238c9f
Update changelog
ptweezy Oct 15, 2026
007ca8b
Import fewer modules in igzip and igzip_threaded
ptweezy Oct 15, 2026
15ea799
Check for a closed file faster in IGzipFile.readline
ptweezy Oct 15, 2026
eb4270c
Update release checklist
rhpvorderman Oct 16, 2026
7470f19
Merge branch 'develop' into fix-crashes
rhpvorderman Oct 16, 2026
1b50969
Merge pull request #264 from ptweezy/fix-crashes
rhpvorderman Oct 16, 2026
e71e618
Merge branch 'develop' into faster-import
rhpvorderman Oct 16, 2026
12e0d6b
Merge pull request #265 from ptweezy/faster-import
rhpvorderman Oct 16, 2026
3999b5f
Merge branch 'develop' into faster-line-iteration
rhpvorderman Oct 16, 2026
a71214a
Merge pull request #266 from ptweezy/faster-line-iteration
rhpvorderman Oct 16, 2026
c299a20
Build ISA-L's aarch64 assembly on macOS arm64
ptweezy Oct 14, 2026
73db6bf
List arm64 in the dependency markers
ptweezy Oct 14, 2026
f7e3c0a
Use the GzipFile write buffer in IGzipFile
ptweezy Oct 14, 2026
2019fd4
Wake igzip_threaded threads instead of waiting for poll timeouts
ptweezy Oct 14, 2026
6c08ca1
Run the tests with AddressSanitizer and ThreadSanitizer on CI
ptweezy Oct 16, 2026
31ba1f3
Fix a crash when reading decompressor attributes from another thread
ptweezy Oct 16, 2026
f892f19
Merge pull request #268 from ptweezy/macos-arm64
rhpvorderman Oct 17, 2026
0ab14fe
Merge branch 'develop' into buffered-writes
rhpvorderman Oct 17, 2026
a93ef81
Merge pull request #269 from ptweezy/buffered-writes
rhpvorderman Oct 17, 2026
5bf06fd
Merge branch 'develop' into threaded-wakeup
rhpvorderman Oct 17, 2026
b09962b
Merge pull request #270 from ptweezy/threaded-wakeup
rhpvorderman Oct 17, 2026
b9be215
Merge branch 'develop' into sanitizer-ci
rhpvorderman Oct 17, 2026
6252316
Merge branch 'develop' into free-threading-attributes
ptweezy Oct 18, 2026
192bbc1
Keep isal_zlib importable with ISA-L 2.30
ptweezy Oct 18, 2026
f2e057d
Raise write errors of igzip_threaded writers instead of waiting forever
ptweezy Oct 18, 2026
c9ec1b9
Merge pull request #271 from ptweezy/sanitizer-ci
rhpvorderman Oct 19, 2026
0a4f3dc
Merge branch 'develop' into isal-2.30-compat
rhpvorderman Oct 19, 2026
f4a0c23
Merge pull request #273 from ptweezy/isal-2.30-compat
rhpvorderman Oct 19, 2026
9f4b0fe
Merge branch 'develop' into threaded-write-error
rhpvorderman Oct 19, 2026
db4ffb6
Merge pull request #275 from ptweezy/threaded-write-error
rhpvorderman Oct 19, 2026
a6fb545
Merge remote-tracking branch 'upstream/develop' into free-threading-a…
ptweezy Oct 19, 2026
7fe7525
Fix igzip_threaded writers at level 0 for data that does not compress
ptweezy Oct 19, 2026
80b86ba
Check for a closed file faster in IGzipFile.write
ptweezy Oct 19, 2026
45508f9
Merge pull request #272 from ptweezy/free-threading-attributes
rhpvorderman Oct 20, 2026
94b3e2f
Merge branch 'develop' into threaded-level-0
rhpvorderman Oct 20, 2026
f47daab
Merge branch 'develop' into faster-write-check
rhpvorderman Oct 20, 2026
fafcb46
Merge pull request #277 from ptweezy/threaded-level-0
rhpvorderman Oct 20, 2026
a4addf7
Merge branch 'develop' into faster-write-check
rhpvorderman Oct 20, 2026
680ed85
Merge pull request #279 from ptweezy/faster-write-check
rhpvorderman Oct 20, 2026
20bd255
Use fixed Huffman codes for Z_FIXED at isal_zlib level 0
ptweezy Oct 20, 2026
61f920c
Raise TypeError for bad arguments to crc32_combine and _GzipReader
ptweezy Oct 20, 2026
e03bb0a
Prevent creating Compress and Decompress objects directly on PyPy
ptweezy Oct 20, 2026
d6799d5
Refuse read-only buffers in _GzipReader.readinto
ptweezy Oct 20, 2026
6442f22
Detect the format of wbits=40..47 streams from their first byte
ptweezy Oct 20, 2026
2f157d6
Fix flush() before any data in wbits=40..47 decompressors
ptweezy Oct 20, 2026
e3d720a
Raise the right error classes when several interpreters import isal
ptweezy Oct 20, 2026
ed377d9
Check for a failed allocation in IgzipDecompressor
ptweezy Oct 20, 2026
3f7fff7
Merge pull request #282 from ptweezy/z-fixed-strategy
rhpvorderman Oct 21, 2026
f5cabf0
Merge branch 'develop' into small-c-fixes
rhpvorderman Oct 21, 2026
5fc95ed
Merge pull request #283 from ptweezy/small-c-fixes
rhpvorderman Oct 21, 2026
d90fe5f
Merge branch 'develop' into wbits-format-detection
rhpvorderman Oct 21, 2026
2f20f09
Merge pull request #284 from ptweezy/wbits-format-detection
rhpvorderman Oct 21, 2026
fbc15f6
Merge branch 'develop' into subinterpreter-errors
rhpvorderman Oct 21, 2026
e11b4ff
Merge pull request #285 from ptweezy/subinterpreter-errors
rhpvorderman Oct 21, 2026
a8547f8
Check for a failed allocation in the "Not a gzipped file" error
ptweezy Oct 22, 2026
f4a4999
Reset next_in after an error in IgzipDecompressor.decompress()
ptweezy Oct 22, 2026
20b71d9
Do not free a NULL lock when a constructor runs out of memory
ptweezy Oct 22, 2026
93fe0e2
Fix the docstring of isal_zlib.Decompress
ptweezy Oct 22, 2026
c917a90
Raise igzip_threaded compression errors instead of waiting forever
ptweezy Oct 22, 2026
4cf20d1
Take the lock in _GzipReader.seek()
ptweezy Oct 22, 2026
1b85b9d
Escape the file path in a generated test program
ptweezy Oct 22, 2026
cfcf8b9
Merge pull request #286 from ptweezy/c-error-paths
rhpvorderman Oct 23, 2026
f0707c2
Merge branch 'develop' into threaded-compress-error
rhpvorderman Oct 23, 2026
2e7752d
Merge branch 'develop' into gzipreader-seek-lock
ptweezy Oct 23, 2026
f4a447b
Merge branch 'develop' into windows-exit-test
ptweezy Oct 23, 2026
13e010d
Remove the temporary files that the tests leave behind
ptweezy Oct 24, 2026
f27ada6
Restore sys.argv and sys.stdin after the command line tests
ptweezy Oct 24, 2026
d0effce
Stop passing "rb" as the queue size in test_close_reader
ptweezy Oct 24, 2026
2ac1c9d
Run tests/test_compat.py in the compatibility tox environment
ptweezy Oct 24, 2026
dcad7cf
Fix the raw deflate unused_data tests when test_offset is 0
ptweezy Oct 24, 2026
f3b243e
Add a timeout to the barrier in test_isal_compress_decompress_threaded
ptweezy Oct 24, 2026
f1030b9
Pass lists instead of itertools.product iterators to parametrize
ptweezy Oct 24, 2026
d04532d
Keep IgzipDecompressor.needs_input False while output is left
ptweezy Oct 24, 2026
ce49460
Test gzip headers with a header CRC and seek() from the end before a …
ptweezy Oct 24, 2026
0874f9e
Pass a list instead of an iterator to parametrize in test_threaded_write
ptweezy Oct 24, 2026
d5595a4
Merge pull request #289 from ptweezy/windows-exit-test
rhpvorderman Oct 27, 2026
76c6955
Merge branch 'develop' into threaded-compress-error
rhpvorderman Oct 27, 2026
892f280
Merge pull request #291 from ptweezy/test-cli-sys-state
rhpvorderman Oct 27, 2026
e9b0817
Merge branch 'develop' into threaded-compress-error
rhpvorderman Oct 27, 2026
bc85d77
Merge pull request #292 from ptweezy/test-barrier-timeout
rhpvorderman Oct 27, 2026
bf2f329
Merge pull request #293 from ptweezy/test-raw-deflate-offset
rhpvorderman Oct 27, 2026
b74f4c0
Merge pull request #294 from ptweezy/test-temp-files
rhpvorderman Oct 27, 2026
6d623a4
Merge pull request #295 from ptweezy/test-close-reader
rhpvorderman Oct 27, 2026
65feb7a
Merge pull request #296 from ptweezy/tox-compatibility-env
rhpvorderman Oct 27, 2026
45fa56d
Merge pull request #297 from ptweezy/parametrize-lists
rhpvorderman Oct 27, 2026
8cd9382
Merge branch 'develop' into threaded-compress-error
rhpvorderman Oct 27, 2026
84f4823
Merge pull request #288 from ptweezy/gzipreader-seek-lock
rhpvorderman Oct 27, 2026
ed5f4da
Merge pull request #298 from ptweezy/decompressor-needs-input
rhpvorderman Oct 27, 2026
90279ca
Merge pull request #299 from ptweezy/test-header-crc-seek-end
rhpvorderman Oct 27, 2026
6bedde5
Merge pull request #287 from ptweezy/threaded-compress-error
rhpvorderman Oct 27, 2026
1080620
Fix -0 and --fast in the igzip command line interface
ptweezy Oct 27, 2026
f2ae568
Check the flag byte for FNAME in test_compress_infile_out_file_no_name
ptweezy Oct 27, 2026
4976ea8
Test threaded writes with blocks larger than the deflate window
ptweezy Oct 27, 2026
ae8e4e5
Check that test_close_writer stops the worker threads
ptweezy Oct 27, 2026
dfb8b06
Check the exception type in test_failure of IgzipDecompressor
ptweezy Oct 27, 2026
69a226a
Test bufsize values of 0 and -1 in decompress()
ptweezy Oct 27, 2026
ce8f150
Check the raw streams in test_reader_not_writable and test_writer_not…
ptweezy Oct 27, 2026
eaf2d97
Make the input buffer tests of IgzipDecompressor reach the input buffer
ptweezy Oct 27, 2026
b8e0ab7
Test that igzip_threaded.open() starts the given number of threads
ptweezy Oct 27, 2026
a9e6da0
Test that IGzipFile compresses with isal_zlib at the given level
ptweezy Oct 27, 2026
028f4a9
Fix the mtime of IGzipFile for a modification time of 0
ptweezy Oct 28, 2026
6f8997a
Merge pull request #300 from ptweezy/cli-fast-level
rhpvorderman Oct 28, 2026
e757d5b
Merge pull request #301 from ptweezy/test-no-name-flag-byte
rhpvorderman Oct 28, 2026
0875ae5
Merge pull request #302 from ptweezy/test-threaded-write-window
rhpvorderman Oct 28, 2026
c1f1925
Merge pull request #303 from ptweezy/test-close-writer-threads
rhpvorderman Oct 28, 2026
e7dcb20
Merge pull request #304 from ptweezy/test-threaded-raw-readable
rhpvorderman Oct 28, 2026
262ad1f
Merge pull request #305 from ptweezy/test-failure-error-type
rhpvorderman Oct 28, 2026
5ae2de7
Rename the random data attributes of TestIgzipDecompressor
ptweezy Oct 28, 2026
c006fc6
Merge pull request #306 from ptweezy/test-decompressor-inputbuf
rhpvorderman Nov 2, 2026
bb970f1
Merge pull request #307 from ptweezy/test-decompress-bufsize
rhpvorderman Nov 2, 2026
5c1e576
Merge pull request #309 from ptweezy/test-threaded-open-threads
rhpvorderman Nov 2, 2026
262ce16
Merge pull request #310 from ptweezy/gzipreader-mtime-zero
rhpvorderman Nov 2, 2026
a751682
Check the arguments IGzipFile passes to compressobj, not the output
ptweezy Nov 2, 2026
aca52b4
Merge pull request #308 from ptweezy/test-igzipfile-isal-output
rhpvorderman Nov 2, 2026
c6f18bc
Organize changelog and update version statement
rhpvorderman Nov 2, 2026
2ced63f
Properly credit @ptweezy
rhpvorderman Nov 2, 2026
b58a599
Fix changelog build errors
rhpvorderman Nov 2, 2026
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
6 changes: 3 additions & 3 deletions .github/release_checklist.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Release checklist
- [ ] Check outstanding issues on JIRA and Github.
- [ ] Check outstanding issues on GitHub.
- [ ] Check [latest documentation](https://python-isal.readthedocs.io/en/latest/) looks fine.
- [ ] Create a release branch.
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
- [ ] Check if the address sanitizer does not find any problems using `tox -e asan`
- [ ] Merge the release branch into `main`.
- [ ] Created an annotated tag with the stable version number. Include changes
from CHANGELOG.rst.
- [ ] Push tag to remote. This triggers the wheel/sdist build on github CI.
- [ ] Push tag to remote. This triggers the wheel/sdist build on GitHub CI.
- [ ] merge `main` branch back into `develop`.
- [ ] Build the new tag on readthedocs. Only build the last patch version of
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
- [ ] Create a new release on github.
- [ ] Create a new release on GitHub.
- [ ] Update the package on conda-forge.
91 changes: 68 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Set up Python 3.11
uses: actions/setup-python@v7
with:
python-version: "3.10"
python-version: "3.11"
- name: Install tox
run: pip install tox
- name: Lint
Expand All @@ -31,15 +31,17 @@ jobs:
tox_env:
- docs
- twine_check
runs-on: ubuntu-latest
# Use the same Ubuntu release as build.os in .readthedocs.yml, so the
# documentation is checked against the libisal that Read the Docs uses.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.10
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: "3.10"
python-version: "3.11"
- name: Install isal
run: sudo apt-get install libisal-dev
- name: Install tox and upgrade setuptools and pip
Expand All @@ -54,28 +56,29 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.14t"
- "pypy-3.10"
- "3.15"
- "3.15t"
- "pypy-3.11"
- "pypy-3.12"
os: ["ubuntu-latest"]
include:
- os: "macos-13"
python-version: "3.10"
- os: "macos-15-intel"
python-version: "3.11"
- os: "macos-latest"
python-version: "3.10"
python-version: "3.11"
- os: "windows-latest"
python-version: "3.10"
python-version: "3.11"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down Expand Up @@ -106,7 +109,7 @@ jobs:
strategy:
matrix:
python_version:
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -136,17 +139,14 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
os: ["ubuntu-latest", "macos-13", "windows-latest"]
python_version: [ "python" ]
include:
- os: "ubuntu-latest"
python_version: "pypy"
os: ["ubuntu-latest", "macos-15-intel", "windows-latest"]
python_version: [ "python==3.11" ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install miniconda.
uses: conda-incubator/setup-miniconda@v3 # https://github.com/conda-incubator/setup-miniconda.
uses: conda-incubator/setup-miniconda@v4 # https://github.com/conda-incubator/setup-miniconda.
with:
channels: conda-forge,defaults
- name: Install requirements (universal)
Expand All @@ -159,6 +159,49 @@ jobs:
env:
PYTHON_ISAL_LINK_DYNAMIC: True

# Run the tests on CPython builds with AddressSanitizer and ThreadSanitizer
# from https://github.com/nascheme/cpython_sanity.
test-sanitizers:
runs-on: ubuntu-latest
# A crash under ThreadSanitizer can hang instead of exiting.
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- sanitizer: address
image: ghcr.io/nascheme/cpython-asan:3.14
# The free-threaded build runs Python threads in parallel.
- sanitizer: thread
image: ghcr.io/nascheme/cpython-tsan:3.14t
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install build dependencies
run: apt-get update && apt-get install -y nasm
- name: Install python-isal with ${{ matrix.sanitizer }} sanitizer
# setuptools-scm needs git, and the container user does not own the
# repository.
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
python -m pip install . pytest pytest-timeout
env:
# The extension modules get -fsanitize from CPython. CFLAGS adds it
# to the C code of ISA-L.
CFLAGS: -fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer -g
- name: Run tests
# Do not set PYTHONDEVMODE. Its debug allocator pads each allocation,
# so AddressSanitizer misses small overflows. --capture=sys prints
# sanitizer reports from C code even when they end the process, and
# -v prints the name of the test before its report.
run: python -m pytest -v tests --capture=sys
env:
# Exit at the first data race. A crash after a race can hang.
TSAN_OPTIONS: halt_on_error=1

deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
Expand All @@ -168,12 +211,13 @@ jobs:
- test-static
- test-dynamic
- test-arch
- test-sanitizers
strategy:
matrix:
os:
- ubuntu-latest
- macos-13
- macos-14
- macos-15-intel
- macos-latest
- windows-latest
cibw_archs_linux: ["x86_64"]
cibw_before_all_linux:
Expand All @@ -195,7 +239,7 @@ jobs:
with:
submodules: recursive
fetch-depth: 0 # Fetch everything to get accurately versioned tag.
- uses: actions/setup-python@v2 # Some issues where caused by higher versions.
- uses: actions/setup-python@v7
name: Install Python
- name: Install cibuildwheel twine wheel
run: python -m pip install cibuildwheel twine wheel
Expand All @@ -216,6 +260,7 @@ jobs:
- name: Build wheels
run: cibuildwheel --output-dir dist
env:
CIBW_ENABLE: "pypy"
CIBW_SKIP: "*-win32 *-manylinux_i686 cp38-macosx_*arm64 cp39-macosx_*arm64" # Skip 32 bit and problematic mac builds.
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
CIBW_BEFORE_ALL_LINUX: ${{ matrix.cibw_before_all_linux }}
Expand Down
145 changes: 145 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,151 @@ Changelog
.. that users understand how the changes affect the new version.


version 1.9.0
-----------------

By far most of the work on this release has been done by
`@ptweezy <https://github.com/ptweezy>`_. Almost all bug fixes and improvements
are their work.

Major changes:

+ Updated included ISA-L library to 2.32.1.
+ Python 3.10 and PyPy 3.10 are no longer supported. Added support for PyPy
3.12 and Python 3.15.
+ Restore PyPy wheel builds.
+ Fix builds on macOS with Apple Silicon, which used the portable C code of
ISA-L rather than its optimized aarch64 assembly. On an Apple M4,
decompression is 1.6 to 3 times faster, CRC-32 is 50 times faster, and
Adler-32 is 7 times faster.

Optimizations and features:

+ ``isal_zlib.compressobj`` supports ``strategy=Z_FIXED`` at compression
level 0. Level 0 then uses fixed Huffman codes instead of starting each
block with a Huffman table of about 110 bytes. This shrinks small flushed
writes, such as websocket messages: JSON messages of about 440 bytes, each
followed by ``flush(Z_SYNC_FLUSH)``, compress to an average of 75 instead
of 188 bytes. Blocks of a few KiB or more can be larger: about 5% for JSON
and 10% for Python source code at 64 KiB. Other strategies, and ``Z_FIXED``
at levels 1 to 3, still give a warning and use the default strategy.
+ Speed up ``import isal.igzip`` and ``import isal.igzip_threaded`` by
importing ``argparse`` and ``shutil`` only when the command line interface
runs, and by dropping the ``multiprocessing`` import.
+ Speed up reading lines from binary ``igzip`` files through iteration,
``readlines()``, and ``readline()``. On an Apple M4, reading FASTQ data is
1.13 times faster, and reading lines of a few bytes is 1.5 times faster.
+ Speed up each ``write()`` call to binary ``igzip`` files on CPython. On an
AMD Ryzen 7 9800X3D with Python 3.14.8, writing FASTQ data or Python source
code one line at a time is 1.1 times faster.
+ Speed up many small writes to ``igzip.IGzipFile`` on Python 3.12 and later.
``IGzipFile`` collects these writes in the write buffer of
``gzip.GzipFile`` and compresses them in large chunks, which makes writing
lines 1.4 times faster.

Bug fixes:

+ Fix zlib streams compressed with a preset dictionary so they can be decoded
by standard zlib, including builds linked against older ISA-L releases.
+ Fix backward seeking in igzip files by discarding buffered compressed data
when rewinding the underlying file.
+ Fix a crash when ``igzip.decompress`` gets an object that is not
bytes-like, such as a ``str``. It raises a ``TypeError`` instead.
+ Fix a crash after creating ``igzip_lib.IgzipDecompressor`` objects with a
``zdict``.
+ Fix error handling when more than one interpreter imports
``isal.isal_zlib`` or ``isal.igzip_lib``, for example, the main interpreter
and a legacy subinterpreter that ``Py_NewInterpreter()`` creates. Each
import replaced the error classes that the C code raises, so
``except isal_zlib.error``, ``except igzip_lib.error``, and
``except gzip.BadGzipFile`` caught errors only in the interpreter that
imported the modules last.
+ Fix a hang in ``isal_zlib.Compress``: after ``flush()`` raised an error for
an unsupported mode, the next call on the same object never returned.
+ Fix a crash when you call ``flush(Z_FINISH)`` twice on a level 0
``isal_zlib.Compress`` object.
+ Fix ``unused_data`` of ``isal_zlib.Decompress`` and
``igzip_lib.IgzipDecompressor``, which could contain bytes from outside the
input buffer when ``max_length`` split the end of a stream. At the end of a
stream, ``isal_zlib.Decompress.unconsumed_tail`` is empty, matching the
CPython fix for gh-158169.
+ Fix ``igzip_lib.IgzipDecompressor.needs_input``, which could be ``True``
after ``decompress()`` returned ``max_length`` bytes while more output was
still available. Readers that stop at the end of the file when
``needs_input`` is ``True``, such as CPython's ``DecompressReader``, raised
``EOFError`` for valid data.
+ Fix ``isal_zlib.decompressobj`` with a ``wbits`` of 40 to 47, which detects
zlib or gzip data. It failed on gzip data when the first ``decompress()``
call got fewer than 2 bytes, for example, when the data arrived byte by
byte.
+ Fix ``isal_zlib.decompressobj`` with a ``wbits`` of 40 to 47 after a
``flush()`` call that came before any data. It then failed on both zlib and
gzip data.
+ ``igzip_threaded.open`` raises ``ValueError`` for a ``block_size`` of about
3.6 GiB or more and ``TypeError`` for a ``compresslevel`` that is not an
integer. Both raised ``SystemError`` before.
+ Fix ``igzip_threaded`` writers at compression level 0, which raised
``OverflowError`` for data that does not compress, such as random bytes or
already compressed files. At compression level 0, ``block_size`` must now be
less than about 2 GiB.
+ Extraordinarily large gzip headers with either a very long comment or
filename will now cause an ``OverflowError`` rather than use more and more
memory. The size is limited to the internal buffer size which is currently
set at 512 KiB.
+ Fix ``igzip_threaded`` readers and writers that waited for a polling timeout
of up to 50 ms at the end of the stream or when closed. Writing and closing
a small file takes less than a millisecond instead of 60 ms.
+ Fix ``igzip_threaded`` writers that waited forever when writing to the
underlying file failed, for example, because the disk was full. A later call
to ``write()``, ``flush()``, or ``close()`` raises the error. After an error,
``close()`` no longer closes a file object that you passed to
``igzip_threaded.open``.
+ Fix ``igzip_threaded`` writers with more than one thread that waited
forever when compressing a block failed, for example, because there was not
enough memory. A later call to ``write()``, ``flush()``, or ``close()``
raises the error.
+ Fix a crash on the free-threaded build when one thread reads
``unused_data`` or ``unconsumed_tail`` of an ``isal_zlib`` decompressor
while another thread decompresses with it. Reading the attributes of
``isal_zlib`` decompressors and ``igzip_lib.IgzipDecompressor`` from other
threads is now safe, and so is calling ``decompress()`` from several
threads at the same time when ``wbits`` detects the format.
+ ``isal_zlib.crc32_combine`` and the ``read()`` and ``seek()`` methods of the
private ``isal_zlib._GzipReader`` class raise ``TypeError`` instead of
``SystemError`` for arguments of the wrong type or number.
``igzip.IGzipFile`` was not affected.
+ Fix a crash on PyPy when you create an ``isal_zlib.Compress`` or
``isal_zlib.Decompress`` object by calling the type, for example,
``isal_zlib.Compress()``, and then use it. Calling the type raises
``TypeError`` now, as it does on CPython. Use ``compressobj()`` and
``decompressobj()`` instead.
+ Fix ``readinto()`` of the private ``isal_zlib._GzipReader`` class, which
wrote into read-only objects such as ``bytes``. It raises ``TypeError`` now.
``igzip.IGzipFile`` was not affected.
+ Fix the ``mtime`` attribute of ``igzip.IGzipFile`` objects in read mode,
which was ``None`` for gzip files with a modification time of 0. It is 0 now,
as in the ``gzip`` module. ``gzip -n``, ``python -m isal.igzip -n``, and
``igzip_threaded`` writers make such files, and so does ``gzip.compress`` by
default on Python 3.14.
+ Fix a crash when there is not enough memory to create an
``igzip_lib.IgzipDecompressor``. It raises ``MemoryError`` now.
+ Fix a crash when there is not enough memory to raise ``BadGzipFile`` for
data that is not in the gzip format, for example, in ``igzip.decompress``.
It raises ``MemoryError`` now.
+ Fix a crash in ``igzip_lib.IgzipDecompressor.decompress()`` after a call on
the same object raised ``MemoryError``. The next call used the input of the
failed call after the caller had released it. This matches the CPython fix
for gh-148395.
+ 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.
+ Fix crashes and wrong data when one thread calls ``seek()`` of the
private ``isal_zlib._GzipReader`` class while another thread reads from the
same object. ``igzip.IGzipFile`` was not affected.


version 1.8.0
-----------------
+ Python 3.14 is supported.
Expand Down
11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ your project please list a python-isal dependency as follows.
``setup.cfg``::

install_requires =
isal; platform.machine == "x86_64" or platform.machine == "AMD64" or platform.machine == "aarch64"
isal; platform.machine == "x86_64" or platform.machine == "AMD64" or platform.machine == "aarch64" or platform.machine == "arm64"

``setup.py``::

extras_require={
":platform.machine == 'x86_64' or platform.machine == 'AMD64' or platform.machine == 'aarch64'": ['isal']
":platform.machine == 'x86_64' or platform.machine == 'AMD64' or platform.machine == 'aarch64' or platform.machine == 'arm64'": ['isal']
},

.. dependency end
Expand All @@ -139,8 +139,9 @@ Differences with zlib and gzip modules
``FINISH_FLUSH``. Other flush modes are not supported and will raise errors.
+ ``zlib.Z_DEFAULT_STRATEGY``, ``zlib.Z_RLE`` etc. are exposed as
``isal_zlib.Z_DEFAULT_STRATEGY``, ``isal_zlib.Z_RLE`` etc. for compatibility
reasons. However, ``isal_zlib`` only supports a default strategy and will
give warnings when other strategies are used.
reasons. However, ``isal_zlib`` supports only the default strategy, and
``Z_FIXED`` at compression level 0. It gives a warning and uses the default
strategy for other strategies, and for ``Z_FIXED`` at levels 1 to 3.
+ ``zlib`` supports different memory levels from 1 to 9 (with 8 default).
``isal_zlib`` supports memory levels smallest, small, medium, large and
largest. These have been mapped to levels 1, 2-3, 4-6, 7-8 and 9. So
Expand Down Expand Up @@ -223,6 +224,8 @@ This project builds upon the software and experience of many. Many thanks to:
+ The `github actions team <https://github.com/orgs/actions/people>`_ for
creating the actions CI service that enables building and testing on all
three major operating systems.
+ `@ptweezy <https://github.com/ptweezy>`_ for discovering and fixing lots and
lots of bugs as well as suggesting and implementing quite a few improvements.
+ `@animalize <https://github.com/animalize>`_ for explaining how to test and
build python-isal for ARM 64-bit platforms.
+ And last but not least: everyone who submitted a bug report or a feature
Expand Down
Loading
Loading