cheetah: fails to build against python 3.15

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:cheetah
Version: 3.4.0-1
User: [email protected]
Usertags: python3.15

Hi!

While rebuilding packages with python 3.15 we found that cheetah fails
to build because load_module was removed.

I'm attaching a debdiff with the upstream patch that replaces the call
to load_module. Please consider fixing this before python 3.15 is in
unstable.

I've also prepared a merge request in salsa,
https://salsa.debian.org/jcfp/cheetah/-/merge_requests/1 which might be
easier to work with depending on your workflow.

Happy hacking,
-- 
"I decry the current tendency to seek patents on algorithms. There are better 
ways to earn a living than to prevent other people from making use of one's 
contributions to computer science."
-- Donald Knuth
Saludos /\/\ /\ >< `/
cheetah_3.4.0-1.1.debdiff (text/plain, 2.2 KB)
diff -Nru cheetah-3.4.0/debian/changelog cheetah-3.4.0/debian/changelog
--- cheetah-3.4.0/debian/changelog	2024-12-03 13:00:33.000000000 +0100
+++ cheetah-3.4.0/debian/changelog	2026-08-05 15:29:42.000000000 +0200
@@ -1,3 +1,11 @@
+cheetah (3.4.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload
+  * Add upstream patch to fix build with Python 3.15:
+    - Stop using load_module() in compat (f935b58)
+
+ -- Maximiliano Curia <[email protected]>  Wed, 05 Aug 2026 15:29:42 +0200
+
 cheetah (3.4.0-1) unstable; urgency=medium
 
   * Watch: revert back to tracking tagged releases.
diff -Nru cheetah-3.4.0/debian/patches/python3.15-load-module.patch cheetah-3.4.0/debian/patches/python3.15-load-module.patch
--- cheetah-3.4.0/debian/patches/python3.15-load-module.patch	1970-01-01 01:00:00.000000000 +0100
+++ cheetah-3.4.0/debian/patches/python3.15-load-module.patch	2026-08-05 15:29:42.000000000 +0200
@@ -0,0 +1,28 @@
+commit f935b58cdf47570b288e59a8a19e157d5909f7ac
+Author: Steve Kowalik <[email protected]>
+Date:   Fri Jul 17 15:07:49 2026 +1000
+
+    Stop using load_module() in compat
+    
+    load_module() has been deprecated effectively since it was added,
+    replaced by exec_module in Python 3.5, switch to using that, since
+    load_module() was removed in Python 3.15.
+    
+    Note this effectively removes support for Python 3.4, but I can reenable
+    that if you prefer.
+
+diff --git a/Cheetah/compat.py b/Cheetah/compat.py
+index 78cfcdd..7810506 100644
+--- a/Cheetah/compat.py
++++ b/Cheetah/compat.py
+@@ -53,7 +53,9 @@ else:
+ 
+     def load_module_from_file(base_name, module_name, filename):
+         specs = importlib.util.spec_from_file_location(module_name, filename)
+-        return specs.loader.load_module()
++        module = importlib.util.module_from_spec(specs)
++        specs.loader.exec_module(module)
++        return module
+ 
+     new_module = types.ModuleType
+ 
diff -Nru cheetah-3.4.0/debian/patches/series cheetah-3.4.0/debian/patches/series
--- cheetah-3.4.0/debian/patches/series	2024-03-19 10:12:04.000000000 +0100
+++ cheetah-3.4.0/debian/patches/series	2026-08-05 15:29:42.000000000 +0200
@@ -1 +1,2 @@
 python3-tests.patch
+python3.15-load-module.patch
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE+JIdOnQEyG4RNSIVxxl2mbKbIyoFAmpzVM0ACgkQxxl2mbKb
IyrI7g/9GF7FZYYoFfEkZn7pqS/1egXqescmlX8a1mqgWtN7QoPTtv0uoODJuppI
RJFFdJ1wromQQZGE9MH/9zSvANAZ3bEOOQpvhxqW9qf8Qd8JNNnTXgottJYbOiWu
tzNW/bUW+GqVqys10pqaTbIypd0feF59zFKaGjsFhd9h3k1t2u+JvMfAG5a+M1B0
gfHlBG5c/2KhcjZVtvzv0keXY0ThRsmSaIlgp6YeIgMC849X52BBbgX8teQwcWem
VrwT3MHfufWElQ3doC+MwAjwAu3DG4HpJ20fl66nKnphuYo0g6MzkTGho/Z/8GVh
+U+WAn48fsGGEXWL4AvF/3kzwZ/yRBod0zsnLXqYzTGLVPV4t/C7atjmmYx0bK6X
YGIrQX9SeUfn0FRfY7rPxeWw4jbGLG1HVHcLmlDSlBOVauDb5tEPD7XZDG3l8Fyp
39F0O02h/TQAHvHlAI367ik+9SN42dJesX/UaBhI9fGGohwUj+dc9o3RN0e/JNXT
hR6auu9L4nd3J+7EMzyWpDROtn5D6MWWzX+E8QdQVWaD3+R4mL2U/O14zycnfNfu
cPvBz1AOh96U6xZ99DSoPYTddVqapZn4+Odp1KqoeOyaOUcB2HPCzB/BGW/e3q0a
xsxBSE437mUvVRfXtwrNMZ5Julq0v8On2XLP3/AaCEae9JNDfqQ=
=ZC/z
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.