Bug#1114712: pyninjotiff: FTBFS with NumPy 2.3
roehling at debian.org
roehling at debian.org
Mon Sep 8 20:44:31 BST 2025
Source: pyninjotiff
Version: 0.4.2-1
Severity: important
User: debian-python at lists.debian.org
Usertags: numpy2.3
Tags: ftbfs, forky, sid
Dear maintainer,
During a test rebuild for NumPy 2.3, pyninjotiff failed to rebuild.
Log Summary:
-------------------------------------------------------------------------------
[...]
x = b'\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01...80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80\x80'
def unpack(x):
try:
return numpy.fromstring(x, typecode)
except ValueError as e:
# strips may be missing EOI
warnings.warn("unpack: %s" % e)
xlen = ((len(x) // (bits_per_sample // 8))
* (bits_per_sample // 8))
> return numpy.fromstring(x[:xlen], typecode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ValueError: The binary mode of fromstring is removed, use frombuffer instead
pyninjotiff/tifffile.py:1898: ValueError
_________________________________ test_write_p _________________________________
x = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02'
def unpack(x):
try:
> return numpy.fromstring(x, typecode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ValueError: The binary mode of fromstring is removed, use frombuffer instead
pyninjotiff/tifffile.py:1892: ValueError
During handling of the above exception, another exception occurred:
def test_write_p():
"""Test saving an image in P mode.
Values are 0, 1, 2, 3, 4, Palette is black, red, green, blue, gray.
"""
area = STEREOGRAPHIC_AREA
palette = [np.array((0, 0, 0, 1)),
np.array((1, 0, 0, 1)),
np.array((0, 1, 0, 1)),
np.array((0, 0, 1, 1)),
np.array((.5, .5, .5, 1)),
]
attrs = dict([('resolution', 1050),
('polarization', None),
('platform_name', 'MSG'),
('sensor', 'seviri'),
("palette", palette),
('name', 'msg_cloudtop_height'),
('level', None),
('modifiers', ()),
('start_time', TIME - datetime.timedelta(minutes=85)),
('end_time', TIME - datetime.timedelta(minutes=80)),
('area', area),
('ancillary_variables', [])])
data = da.tile(da.repeat(da.arange(5, chunks=1024, dtype=np.uint8), 205)[:-1],
1024).reshape((1, 1024, 1024))[:, :1024]
data = xr.DataArray(data, coords={'bands': ['P']}, dims=[
'bands', 'y', 'x'], attrs=attrs)
kwargs = {'compute': True, 'fill_value': None, 'sat_id': 9000014,
'chan_id': 1900015, 'data_cat': 'GPRN', 'data_source': 'SMHI',
'physic_unit': 'NONE', "physic_value": "NONE",
"description": "NWCSAF Cloud Top Height"}
img = FakeImage(data)
with tempfile.NamedTemporaryFile(delete=DELETE_FILES) as tmpfile:
filename = tmpfile.name
if not DELETE_FILES:
print(filename)
save(img, filename, data_is_scaled_01=True, **kwargs)
> colormap, res = _load_file_values_with_colormap(filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyninjotiff/tests/test_ninjotiff.py:843:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyninjotiff/tests/test_ninjotiff.py:713: in _load_file_values_with_colormap
res = page.asarray(colormapped=False).squeeze()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyninjotiff/tifffile.py:1917: in asarray
tile = unpack(decompress(fh.read(bytecount)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
x = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02'
def unpack(x):
try:
return numpy.fromstring(x, typecode)
except ValueError as e:
# strips may be missing EOI
warnings.warn("unpack: %s" % e)
xlen = ((len(x) // (bits_per_sample // 8))
* (bits_per_sample // 8))
> return numpy.fromstring(x[:xlen], typecode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ValueError: The binary mode of fromstring is removed, use frombuffer instead
pyninjotiff/tifffile.py:1898: ValueError
------------------------------ Captured log call -------------------------------
WARNING pyninjotiff.ninjotiff:ninjotiff.py:567 Ignoring palette's alpha.
=============================== warnings summary ===============================
pyninjotiff/tifffile.py:154
/build/reproducible-path/pyninjotiff-0.4.2/.pybuild/cpython3_3.13_pyninjotiff/build/pyninjotiff/tifffile.py:154: UserWarning: failed to import the optional _tifffile C extension module.
Loading of some compressed images will be slow.
Tifffile.c can be obtained at http://www.lfd.uci.edu/~gohlke/
warnings.warn(
pyninjotiff/tests/test_ninjotiff.py:37
/build/reproducible-path/pyninjotiff-0.4.2/.pybuild/cpython3_3.13_pyninjotiff/build/pyninjotiff/tests/test_ninjotiff.py:37: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
TIME = datetime.datetime.utcnow()
pyninjotiff/tests/test_ninjotiff.py: 11 warnings
/build/reproducible-path/pyninjotiff-0.4.2/.pybuild/cpython3_3.13_pyninjotiff/build/pyninjotiff/ninjotiff.py:911: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
file_dt = datetime.utcnow()
pyninjotiff/tests/test_ninjotiff.py: 11 warnings
/build/reproducible-path/pyninjotiff-0.4.2/.pybuild/cpython3_3.13_pyninjotiff/build/pyninjotiff/tifffile.py:1895: UserWarning: unpack: The binary mode of fromstring is removed, use frombuffer instead
warnings.warn("unpack: %s" % e)
pyninjotiff/tests/test_ninjotiff.py: 10 warnings
/usr/lib/python3/dist-packages/xarray/core/common.py:158: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
return float(self.values)
pyninjotiff/tests/test_ninjotiff.py::test_write_bw_fill
pyninjotiff/tests/test_ninjotiff.py::test_write_bw_inverted_ir_fill
/usr/lib/python3/dist-packages/dask/array/chunk.py:279: RuntimeWarning: invalid value encountered in cast
return x.astype(astype_dtype, **kwargs)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_bw - ValueError: The b...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_bw_inverted_ir - Value...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_bw_fill - ValueError: ...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_bw_inverted_ir_fill - ...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_rgb - ValueError: The ...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_rgb_with_a - ValueErro...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_rgb_tb - ValueError: T...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_rgba - ValueError: The...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_bw_colormap - ValueErr...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_ir_colormap - ValueErr...
FAILED pyninjotiff/tests/test_ninjotiff.py::test_write_p - ValueError: The bi...
================= 11 failed, 1 skipped, 36 warnings in 51.26s ==================
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /build/reproducible-path/pyninjotiff-0.4.2/.pybuild/cpython3_3.13_pyninjotiff/build; python3.13 -m pytest --pyargs pyninjotiff
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.13 returned exit code 13
make: *** [debian/rules:14: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2025-09-08T06:17:35Z
-------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/debian/developers-roehling.numpy/artifact/2453927/
About the archive rebuild: The build was made on debusine.debian.net,
using sbuild.
You can find the build task here:
https://debusine.debian.net/debian/developers-roehling.numpy/work-request/163707/
If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.
Cheers
Timo
More information about the Pkg-grass-devel
mailing list