#1146871 monty: FTBFS against python 3.15rc2

Package:
src:monty
Source:
src:monty
Submitter:
Maximiliano Curia
Date:
2026-09-06 15:35:02 UTC
Severity:
normal
Tags:
#1146871#5
Date:
2026-09-06 15:32:31 UTC
From:
To:
Hi!

While rebuilding the python related packages against the Python 3.15rc2
version we found that monty fails to build from source [1].

The problem happens because `val = dct.popitem()` now pops the last
element instead of the first one. This is due to a bugfix in UserDict
which was popping FIFO instead of LIFO. [2]

There's one confusing factor here, which is that in the latest release
(not yet in Debian), upstream moved to inherit from dict instead of
UserDict, and dict always had this LIFO behavior, so I'm not sure how it
is that these tests aren't failing upstream regardless of the Python
version.

In any case, it's possible to workaround this issue by allowing the
problematic test to take either the first or the last element. The test
only cares that the element gets removed from the dictionary when
popping it, so that should be fine.

I have created a patch with this workaround and applied it in the
sandbox [3] to be able to build the packages that depend on monty,
please consider applying the patch to support the upcoming 3.15 version.

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

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4453093/
[2]: https://github.com/python/cpython/issues/147957
[3]: https://debusine.debian.net/debian/r-python-python3.15/