#1149340 python-csb: FTBFS against python 3.15rc2 (several failing tests)

Package:
src:python-csb
Source:
src:python-csb
Submitter:
Margarita Manterola
Date:
2026-09-29 14:11:02 UTC
Severity:
normal
Tags:
#1149340#5
Date:
2026-09-29 14:08:42 UTC
From:
To:
Hi!

While rebuilding the python related packages against the Python 3.15rc2 version
we found that python-csb fails to build from source:
https://debusine.debian.net/debian/r-python-python3.15/artifact/4856727/

From the log, the error seems to be:

======================================================================
ERROR: testRotationMatrix (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/numeric.TestMath.testRotationMatrix)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/numeric/__init__.py", line 109, in testRotationMatrix
    R2 = rotation_matrix([0, 0, 1], np.pi / 2.0)
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/numeric/__init__.py", line 155, in rotation_matrix
    axis = numpy.asfarray(axis) / norm(axis)
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 778, in __getattr__
    raise AttributeError(
    ...<3 lines>...
    )
AttributeError: `np.asfarray` was removed in the NumPy 2.0 release. Use `np.asarray` with a proper dtype instead.

======================================================================
ERROR: testRead (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/bio/io/mrc.TestDensityMapReader.testRead)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/bio/io/mrc/__init__.py", line 36, in testRead
    density = self.reader.read()
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/bio/io/mrc.py", line 248, in read
    array = numpy.fromstring(map_data, numpy.float32, count)
ValueError: The binary mode of fromstring is removed, use frombuffer instead

======================================================================
ERROR: testReconstructHeader (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/bio/io/mrc.TestDensityMapWriter.testReconstructHeader)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/bio/io/mrc/__init__.py", line 55, in setUp
    self.density = self.reader.read()
                   ~~~~~~~~~~~~~~~~^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/bio/io/mrc.py", line 248, in read
    array = numpy.fromstring(map_data, numpy.float32, count)
ValueError: The binary mode of fromstring is removed, use frombuffer instead

======================================================================
ERROR: testWriteDensity (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/bio/io/mrc.TestDensityMapWriter.testWriteDensity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/bio/io/mrc/__init__.py", line 55, in setUp
    self.density = self.reader.read()
                   ~~~~~~~~~~~~~~~~^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/bio/io/mrc.py", line 248, in read
    array = numpy.fromstring(map_data, numpy.float32, count)
ValueError: The binary mode of fromstring is removed, use frombuffer instead

======================================================================
ERROR: testFiveReplicas (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/statistics/samplers.TestReplicaHistory.testFiveReplicas)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 899, in testFiveReplicas
    assert(self._assertIdenticalProjTrajs(samples, swap_interval))
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 866, in _assertIdenticalProjTrajs
    ok.append(True in [np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (85,) (75,)

======================================================================
ERROR: testFiveReplicasOffset (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/statistics/samplers.TestReplicaHistory.testFiveReplicasOffset)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 909, in testFiveReplicasOffset
    assert(self._assertIdenticalProjTrajs(samples, swap_interval, first_swap))
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 866, in _assertIdenticalProjTrajs
    ok.append(True in [np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (103,) (73,)

======================================================================
ERROR: testFourReplicas (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/statistics/samplers.TestReplicaHistory.testFourReplicas)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 889, in testFourReplicas
    assert(self._assertIdenticalProjTrajs(samples, swap_interval))
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 866, in _assertIdenticalProjTrajs
    ok.append(True in [np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (125,) (105,)

======================================================================
ERROR: testTwoReplicas (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/statistics/samplers.TestReplicaHistory.testTwoReplicas)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 879, in testTwoReplicas
    assert(self._assertIdenticalProjTrajs(samples, swap_interval))
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/statistics/samplers/__init__.py", line 866, in _assertIdenticalProjTrajs
    ok.append(True in [np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (195,) (305,)

======================================================================
ERROR: runTest (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/core.TestDeepCopy.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/core/__init__.py", line 21, in runTest
    self.assertNotEquals(id(obj), id(copy))
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestDeepCopy' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?

======================================================================
FAIL: testRecusionLimit (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/io.TestDumpLoad.testRecusionLimit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/io/__init__.py", line 528, in testRecusionLimit
    with self.assertRaises(RuntimeError):
         ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
AssertionError: RuntimeError not raised

======================================================================
FAIL: testComparison (build/reproducible-path/python-csb-1-2-5+dfsg/-pybuild/cpython3_3-14_csb/build/csb/test/cases/core.TestEnum.testComparison)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/reproducible-path/python-csb-1.2.5+dfsg/.pybuild/cpython3_3.14_csb/build/csb/test/cases/core/__init__.py", line 73, in testComparison
    self.assertFalse(self.enum.C == 66)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
AssertionError: True is not false
----------------------------------------------------------------------

Please note that while we ran into this error during the rebuild against Python
3.15, that doesn't mean that the root cause for the failure is necessarily the
new Python version.

Setting the severity to important for now. Once Python 3.15 is released and
later added to python3-defaults, this bug will become release critical.