Package: src:sfepy
Version: 2026.2-1
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 sfepy fails to build from source [1].
The error is: AttributeError: 'SourceFileLoader' object has no attribute
'load_module'. Did you mean '.exec_module' instead of '.load_module'?
This is caused by load_module being deprecated, I've added a patch to
migrate away from it.
I've applied the fix in the sandbox [2] to verify that it builds
successfully, 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/4645423/
[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: SourceFileLoader.load_module() was removed in Python 3.15, use exec_module() instead
Author: Maximiliano Curia <[email protected]>
--- a/sfepy/config.py
+++ b/sfepy/config.py
@@ -78,8 +78,11 @@ class Config:
pass
try:
- self.site_cfg = (SourceFileLoader('site_cfg', config_filename)
- .load_module())
+ import importlib.util
+ loader = SourceFileLoader('site_cfg', config_filename)
+ spec = importlib.util.spec_from_loader('site_cfg', loader)
+ self.site_cfg = importlib.util.module_from_spec(spec)
+ loader.exec_module(self.site_cfg)
except FileNotFoundError:
print(f'Warning: SfePy site configuration file ({config_filename})'