Package: src:python-term-image Version: 0.7.2-2 User: [email protected] Usertags: python3.15 Tags: patch, ftbfs, forky, sid Severity: important
Hi! While rebuilding the python related packages against the Python 3.15rc2 version we found that python-term-image fails to build from source [1]. The error is caused by the fact that the code inherits from classmethod and adds a parameter to the `__init__` method of the child class. But in Python 3.15 classmethod now has an explicit `__new__` method that forces the number of parameters, so in order to add a parameter to `__init__`, there needs to be a `__new__` that discards it before calling the parent class. I've applied this fix in the sandbox [2] to verify that it builds successfully, please consider applying the patch to support the upcoming 3.15 version. This patch should also be forwarded upstream, although it seems it's not really active anymore. 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/4456293/ [2]: https://debusine.debian.net/debian/r-python-python3.15/ -- "Can you imagine what I would do if I could do all I can?" -- Sun Tzu Saludos /\/\ /\ >< `/
Description: Fix ClassInstanceMethod in Python 3.15 Pass only f_owner to classmethod.__new__ as Python 3.15 strictly enforces classmethod argument count. Author: Maximiliano Curia <[email protected]> Forwarded: no Last-Update: 2026-09-08 Index: python-term-image/src/term_image/utils.py =================================================================== --- python-term-image.orig/src/term_image/utils.py +++ python-term-image/src/term_image/utils.py @@ -53,6 +53,11 @@ class ClassInstanceMethod(classmethod): and when invoked via an instance, behaves like an instance method. """ + def __new__( + cls, f_owner: FunctionType, f_instance: Optional[FunctionType] = None + ): + return super().__new__(cls, f_owner) + def __init__( self, f_owner: FunctionType, f_instance: Optional[FunctionType] = None ):

