Package: src:python-pecan
Version: 1.5.1-6
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-pecan causes python-wsme to fail to build
from source [1].
This is because python-pecan uses load_module, which was removed in
python 3.15
This was already fixed upstream with PR #173: The load_module method was
deprecated in Python 3.4 and was removed in Python 3.15 [2].
I've applied the upstream fix in the sandbox [3] to verify that it
builds successfully and be able to build depending packages, 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/4524706/
[2]: https://github.com/pecan/pecan/pull/173
[3]: 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: Replace load_module
The load_module method was deprecated in Python 3.4 and was removed in
Python 3.15.
Author: Takashi Kajinami <[email protected]>
Origin: upstream, https://github.com/pecan/pecan/pull/173
---
Index: python-pecan/pecan/configuration.py
===================================================================
--- python-pecan.orig/pecan/configuration.py
+++ python-pecan/pecan/configuration.py
@@ -3,6 +3,7 @@ import inspect
import os
import sys
from importlib.machinery import SourceFileLoader
+from importlib.util import (module_from_spec, spec_from_loader)
IDENTIFIER = re.compile(r'[a-z_](\w)*$', re.IGNORECASE)
@@ -168,7 +169,12 @@ def conf_from_file(filepath):
# This provides more verbose import-related error reporting than exec()
absname, _ = os.path.splitext(abspath)
basepath, module_name = absname.rsplit(os.sep, 1)
- SourceFileLoader(module_name, abspath).load_module(module_name)
+
+ loader = SourceFileLoader(module_name, abspath)
+ spec = spec_from_loader(module_name, loader)
+ module = module_from_spec(spec)
+
+ spec.loader.exec_module(module)
# If we were able to import as a module, actually exec the compiled code
exec(compiled, globals(), conf_dict)