In Python 3.15, the default compression level is reduced to 6.
Changed in version 3.15: The default compression level was reduced to 6 (down from 9). It is the default level used by most compression tools and a better tradeoff between speed and performance.
DeterministicGzipFile inherits from that class, and sets the compression level to 9 (two places with the default).
The tests for this object started failing on the nonmatching checksums with Python 3.15.0a6 in Fedora Linux, where I test the readiness of packages to support new Python versions.
This can either be mitigated by matching the compression level to Python's if the class is supposed to closely follow upstream, or increase the compression level of the gzip's GZipFile instance in the test:
|
with GzipFile(filename='', mode='wb', fileobj=fobj, mtime=0) as gzobj: |
I tested the first approach locally on my machine, and the tests passed.
In Python 3.15, the default compression level is reduced to 6.
DeterministicGzipFileinherits from that class, and sets the compression level to 9 (two places with the default).nibabel/nibabel/_compression.py
Line 85 in db76723
The tests for this object started failing on the nonmatching checksums with Python 3.15.0a6 in Fedora Linux, where I test the readiness of packages to support new Python versions.
This can either be mitigated by matching the compression level to Python's if the class is supposed to closely follow upstream, or increase the compression level of the gzip's
GZipFileinstance in the test:nibabel/nibabel/tests/test_openers.py
Line 369 in db76723
I tested the first approach locally on my machine, and the tests passed.