diff -Nru gramps-5.1.6+dfsg/debian/changelog gramps-5.1.6+dfsg/debian/changelog --- gramps-5.1.6+dfsg/debian/changelog 2024-03-10 17:47:54.000000000 +0000 +++ gramps-5.1.6+dfsg/debian/changelog 2024-03-14 19:20:31.000000000 +0000 @@ -1,8 +1,8 @@ -gramps (5.1.6+dfsg-1ubuntu1~ppa1) noble; urgency=medium +gramps (5.1.6+dfsg-1ubuntu1~ppa2) noble; urgency=medium - * Apply patch to fix FTBFS with Python 3.12 (Closes: #1061743) + * Apply patches to fix FTBFS with Python 3.12 (Closes: #1061743) - -- Ross Gammon Sun, 10 Mar 2024 18:47:54 +0100 + -- Ross Gammon Thu, 14 Mar 2024 20:20:31 +0100 gramps (5.1.6+dfsg-1) unstable; urgency=medium diff -Nru gramps-5.1.6+dfsg/debian/patches/python3_12.patch gramps-5.1.6+dfsg/debian/patches/python3_12.patch --- gramps-5.1.6+dfsg/debian/patches/python3_12.patch 2024-03-10 17:47:54.000000000 +0000 +++ gramps-5.1.6+dfsg/debian/patches/python3_12.patch 2024-03-14 19:20:31.000000000 +0000 @@ -5,6 +5,9 @@ fail. Caused Gramps to be removed from Debian Testing and Ubuntu Noble. Debian Bug - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061743 + Also needed to backport 2 commits from the Gramps 5.2 branch: + https://github.com/gramps-project/gramps/commit/47f392ef70618cfece86e5210c19c2c1a768a4e0 + https://github.com/gramps-project/gramps/commit/d5dd8d698cdd6cb0ca0e080743fa9b0e2c64a391 Origin: https://github.com/gramps-project/gramps/pull/1672 Bug: https://gramps-project.org/bugs/view.php?id=13212 Last-Update: 2024-03-10 @@ -35,6 +38,17 @@ from gramps.plugins.lib.libmixin import DbMixin from gramps.plugins.lib import libgedcom from gramps.gen.utils.libformatting import ImportInfo +@@ -47,8 +46,8 @@ from gramps.gen.utils.libformatting impo + # a quick turnround, without having to restart Gramps. + module = __import__("gramps.plugins.lib.libgedcom", + fromlist=["gramps.plugins.lib"]) # why o why ?? as above! +-import imp +-imp.reload(module) ++import importlib ++importlib.reload(module) + + from gramps.gen.config import config + @@ -94,6 +93,8 @@ def importData(database, filename, user) return @@ -58,3 +72,104 @@ from gi.repository import Gtk, Gdk #------------------------------------------------------------------------ +Index: gramps-5.1.6+dfsg/gramps/gen/plug/_manager.py +=================================================================== +--- gramps-5.1.6+dfsg.orig/gramps/gen/plug/_manager.py ++++ gramps-5.1.6+dfsg/gramps/gen/plug/_manager.py +@@ -372,13 +372,9 @@ class BasePluginManager: + Reloads modules that might not be in the path. + """ + try: +- import imp +- fp, pathname, description = imp.find_module(pdata.mod_name, [pdata.fpath]) +- try: +- module = imp.load_module(pdata.mod_name, fp, pathname,description) +- finally: +- if fp: +- fp.close() ++ spec = importlib.util.find_spec(pdata.mod_name, [pdata.fpath]) ++ module = importlib.util.module_from_spec(spec) ++ spec.loader.exec_module(module) + except: + if pdata.mod_name in sys.modules: + del sys.modules[pdata.mod_name] +Index: gramps-5.1.6+dfsg/gramps/gen/utils/grampslocale.py +=================================================================== +--- gramps-5.1.6+dfsg.orig/gramps/gen/utils/grampslocale.py ++++ gramps-5.1.6+dfsg/gramps/gen/utils/grampslocale.py +@@ -264,7 +264,7 @@ class GrampsLocale: + self.lang = loc[0] + self.encoding = loc[1] + else: +- (lang, loc) = _check_mswin_locale(locale.getdefaultlocale()[0]) ++ (lang, loc) = _check_mswin_locale(locale.getlocale()[0]) + if lang: + self.lang = lang + self.encoding = loc[1] +@@ -352,7 +352,7 @@ class GrampsLocale: + _failure = False + try: + locale.setlocale(locale.LC_ALL, '') +- if not _check_locale(locale.getdefaultlocale(envvars=('LC_ALL', 'LANG', 'LANGUAGE'))): ++ if not _check_locale(locale.getlocale(category=locale.LC_MESSAGES)): + LOG.debug("Usable locale not found, localization settings ignored."); + self.lang = 'C' + self.encoding = 'ascii' +@@ -978,22 +978,14 @@ class GrampsLocale: + from ..lib.grampstype import GrampsType + return GrampsType.xml_str(name) + +- def format(self, format, val, grouping=False, monetary=False): +- """ +- Format a number in the current numeric locale. See python's +- locale.format for details. ICU's formatting codes are +- incompatible with locale's, so just use locale.format for now. +- """ +- return locale.format(format, val, grouping, monetary) +- +- def format_string(self, format, val, grouping=False): ++ def format_string(self, fmt, val, grouping=False, monetary=False): + """ + Format a string in the current numeric locale. See python's + locale.format_string for details. ICU's message formatting codes are + incompatible with locale's, so just use locale.format_string + for now. + """ +- return locale.format_string(format, val, grouping) ++ return locale.format_string(fmt, val, grouping, monetary) + + def float(self, val): + """ +Index: gramps-5.1.6+dfsg/gramps/plugins/gramplet/pedigreegramplet.py +=================================================================== +--- gramps-5.1.6+dfsg.orig/gramps/plugins/gramplet/pedigreegramplet.py ++++ gramps-5.1.6+dfsg/gramps/plugins/gramplet/pedigreegramplet.py +@@ -260,13 +260,13 @@ class PedigreeGramplet(Gramplet): + if g == 0: + self.link(_("Generation 1"), 'PersonList', handles, + tooltip=_("Double-click to see people in generation")) +- percent = glocale.format('%.2f', 100) + percent_sign ++ percent = glocale.format_string('%.2f', 100) + percent_sign + self.append_text(_(" has 1 of 1 individual (%(percent)s complete)\n") % {'percent': percent}) + else: + all.extend(handles) + self.link(_("Generation %d") % g, 'PersonList', handles, + tooltip=_("Double-click to see people in generation %d") % g) +- percent = glocale.format('%.2f', float(count)/2**(g-1) * 100) + percent_sign ++ percent = glocale.format_string('%.2f', float(count)/2**(g-1) * 100) + percent_sign + self.append_text( + # translators: leave all/any {...} untranslated + ngettext(" has {count_person} of {max_count_person} " +Index: gramps-5.1.6+dfsg/gramps/plugins/textreport/numberofancestorsreport.py +=================================================================== +--- gramps-5.1.6+dfsg.orig/gramps/plugins/textreport/numberofancestorsreport.py ++++ gramps-5.1.6+dfsg/gramps/plugins/textreport/numberofancestorsreport.py +@@ -115,7 +115,7 @@ class NumberOfAncestorsReport(Report): + gen += 1 + theoretical = math.pow(2, (gen - 1)) + total_theoretical += theoretical +- percent = '(%s%%)' % self._locale.format( ++ percent = '(%s%%)' % self._locale.format_string( + '%3.2f', ((sum(thisgen.values()) / theoretical) * 100)) + + # TC # English return something like: