diff --git a/0001-Module_loader_fix_Python_3_12.patch b/0001-Module_loader_fix_Python_3_12.patch new file mode 100644 index 0000000..29086d3 --- /dev/null +++ b/0001-Module_loader_fix_Python_3_12.patch @@ -0,0 +1,21 @@ +diff -ruN a/bottle.py b/bottle.py +--- a/bottle.py 2023-03-04 16:33:42.000000000 +0100 ++++ b/bottle.py 2023-06-28 09:52:43.757114094 +0200 +@@ -1803,10 +1803,15 @@ + '__all__': [], '__loader__': self}) + sys.meta_path.append(self) + ++ def find_spec(self, fullname, path, target=None): ++ if '.' not in fullname: return ++ if fullname.rsplit('.', 1)[0] != self.name: return ++ from importlib.util import spec_from_loader ++ return spec_from_loader(fullname, self) ++ + def find_module(self, fullname, path=None): + if '.' not in fullname: return +- packname = fullname.rsplit('.', 1)[0] +- if packname != self.name: return ++ if fullname.rsplit('.', 1)[0] != self.name: return + return self + + def load_module(self, fullname): diff --git a/python-bottle.spec b/python-bottle.spec index 5898627..87063ce 100644 --- a/python-bottle.spec +++ b/python-bottle.spec @@ -2,14 +2,15 @@ Name: python-%{srcname} Version: 0.12.25 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Fast and simple WSGI-framework for small web-applications License: MIT URL: http://bottlepy.org Source0: https://github.com/bottlepy/%{srcname}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz -# Fix deprecation for tests that breaks 3.12. Already upstream, only in master: -# https://github.com/bottlepy/bottle/commit/f1d668b4c5a2657fa4786fe170d24829f511cad9 +# Fix module import for 3.12 already in master at: +# https://github.com/bottlepy/bottle/commit/ca6762c559c5e71e0dff71dc97eb4c6b3ed9bbcd +Patch0: 0001-Module_loader_fix_Python_3_12.patch BuildArch: noarch @@ -57,6 +58,9 @@ rm %{buildroot}%{_bindir}/bottle.py %{python3_sitelib}/*.py %changelog +* Wed Jun 28 2023 Federico Pellegrin - 0.12.25-3 +- Fix module loading for Python 3.12 + * Tue Jun 13 2023 Python Maint - 0.12.25-2 - Rebuilt for Python 3.12