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

Package:
src:python-csb
Source:
src:python-csb
Submitter:
Margarita Manterola
Date:
2026-10-23 19:23:03 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.

#1149340#10
Date:
2026-10-23 16:46:09 UTC
From:
To:
Hello,

Bug #1149340 in python-csb reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/med-team/python-csb/-/commit/d87bd0480b98235a6c5055692dee4e3717d0a5ee
    - replace numpy.asfarray (removed in numpy 2.0) with numpy.asarray
    - replace binary numpy.fromstring with numpy.frombuffer
    - fix failing test-suite assertions (replica exchange samplers,
      enum comparison, pickling recursion limit)
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1149340

#1149340#17
Date:
2026-10-23 19:20:22 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
python-csb, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1149340@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Tille <tille@debian.org> (supplier of updated python-csb package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 23 Oct 2026 20:43:07 +0200
Source: python-csb
Architecture: source
Version: 1.2.5+dfsg-11
Distribution: unstable
Urgency: medium
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Changed-By: Andreas Tille <tille@debian.org>
Closes: 1085900 1149340
Changes:
 python-csb (1.2.5+dfsg-11) unstable; urgency=medium
 .
   * Fix Python3.12 string syntax
     Closes: #1085900
   * Exclude Python 3.15 from build (Closes: #1149340)
     as well as fixing further NumPy issues
       - replace numpy.asfarray (removed in numpy 2.0) with numpy.asarray
       - replace binary numpy.fromstring with numpy.frombuffer
       - fix failing test-suite assertions (replica exchange samplers,
         enum comparison, pickling recursion limit)
   * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
   * d/watch: version=5
   * Standards-Version: 4.7.4 (routine-update)
   * Reflow Uploaders field (cme)
   * Remove Priority field (cme)
   * Drop 'Rules-Requires-Root: no' from d/control (routine-update)
   * Reformat the Last-Update date as ISO YYYY-MM-DD.
   * debputy lint --auto-fix (routine-update)
Checksums-Sha1:
 b4a2485b90926edf350eeaf91b18bd0d982919e3 2267 python-csb_1.2.5+dfsg-11.dsc
 4b11434539ed3a20d55c33a7fed04d636b48d1c5 14348 python-csb_1.2.5+dfsg-11.debian.tar.xz
 7d9a8fbba251d20362c0fe95c9255d7e16f35777 9228 python-csb_1.2.5+dfsg-11_amd64.buildinfo
Checksums-Sha256:
 e4cc18b9f998ea6aabce344c047eac852e22ae5a5adfb2c9429effda911771bd 2267 python-csb_1.2.5+dfsg-11.dsc
 5389fb668b49b444e19ea6783e2f9954320353e2b64dbef9d4b039241ce10dbf 14348 python-csb_1.2.5+dfsg-11.debian.tar.xz
 f06bc2b52f1d948981edee2e0e77fc1bae0b436a5e99df2924c75f97c465e0fa 9228 python-csb_1.2.5+dfsg-11_amd64.buildinfo
Files:
 ae933ae5e51102ae2b9be48eef89feba 2267 science optional python-csb_1.2.5+dfsg-11.dsc
 ce6ae5b25d5ce80f2177af37096b4cdc 14348 science optional python-csb_1.2.5+dfsg-11.debian.tar.xz
 5b5a9301f89cbd519027212f8c38b067 9228 science optional python-csb_1.2.5+dfsg-11_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmrbrhoRHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtEwmhAAklWMHoOzrWdbiDcDWlVjMHNSWiwAOivf
IVtyDytIbWH+uqXlh2Jk4gzVcnL6Wd7Ki9kt+iB0w4pAQV4tOoP4vXNML9+ZL3cX
4xF/yGtrdmcclYeZihX1hALRi5Sw/I9XmVE8knuRlwvm5NjH3yRNQi5VfMAkYeq1
bTxKJweDgKxJfI1+QHoED4/OkNBYO1LAwkDI7Tgh30CEe4MOiFQ/M/Ap7+ETte/8
6i3b2jImioUPprDHupL/w9S6rQDrz9ScI2KaRajYRK8eWESo9xQzdZ4e5ZDzAb/j
qB0YO1q4t21aQL2UQc3y5sh62zLfgFkYdjk9IlJxEHckh/d9W5NHtumPI1vOKMU2
fQJ6drKv7Y8P+TLgQALdGEKLplvm4QKd6acIrhE/rAVtOZOSd+gMLR8iKGUCGVrj
zdobmyLKX65XRgsbThRRpCD+RNEfqaJjoS6UsoXTvxJFFqcLGBgXc122OvA50Emi
mRTzNEdPY3qANakFFHVcSMvrAhx40wVzlr39sBu3av0yCiRRiefLwdXuMvPmoPZW
bNlPrSg/lvccih7oLeZxleLP9u7aeomUxQ7wtn43KaLQv+wz1iI6De8ODLOlHg6d
0sxzvbKKkEGyIPgv9nrNf9NVPGHttn4QgGNVUDPJoC8tKjcDCuVdvalCgMPas7Bf
/ZVO+YRTPds=
=XPOi
-----END PGP SIGNATURE-----