#10 Patch for Python 3.13
Merged 7 months ago by limb. Opened 7 months ago by limb.
rpms/ limb/gnucash rawhide  into  rawhide

@@ -0,0 +1,55 @@ 

+ From 1d8c525afc31ba3b02fcd86fb8dc1f484ead6c05 Mon Sep 17 00:00:00 2001

+ From: John Ralls <jralls@ceridwen.us>

+ Date: Fri, 24 Nov 2023 14:52:07 -0800

+ Subject: [PATCH] Bug 799138 - Port to new Python C config API

+ 

+ ---

+  gnucash/python/gncmod-python.c | 23 +++++++++++++++++++----

+  1 file changed, 19 insertions(+), 4 deletions(-)

+ 

+ diff --git a/gnucash/python/gncmod-python.c b/gnucash/python/gncmod-python.c

+ index d2bd8a5183e..aa11b6884d5 100644

+ --- a/gnucash/python/gncmod-python.c

+ +++ b/gnucash/python/gncmod-python.c

+ @@ -65,15 +65,29 @@ libgncmod_python_gnc_module_description(void)

+  int

+  libgncmod_python_gnc_module_init(int refcount)

+  {

+ -    Py_Initialize();

+ -

+ +#ifdef __WIN32

+      wchar_t* argv = NULL;

+ -    PySys_SetArgv(0, &argv);

+ -

+ +#else

+ +    char* argv = NULL;

+ +#endif

+ +    PyStatus status;

+ +    PyConfig config;

+ +    PyConfig_InitPythonConfig(&config);

+ +    status = PyConfig_SetBytesArgv(&config, 0, &argv);

+ +    if (PyStatus_Exception(status))

+ +    {

+ +        PyConfig_Clear(&config);

+ +        return FALSE;

+ +    }

+ +    Py_Initialize();

+      gchar *pkgdatadir = gnc_path_get_pkgdatadir();

+      gchar *init_filename = g_build_filename(pkgdatadir, "python/init.py", (char*)NULL);

+      g_debug("Looking for python init script at %s", init_filename);

+ +#ifdef __WIN32

+ +    FILE *fp = fopen(init_filename, "rb");

+ +#else

+      FILE *fp = fopen(init_filename, "r");

+ +#endif

+      if (fp)

+      {

+          PyRun_SimpleFile(fp, init_filename);

+ @@ -87,6 +101,7 @@ libgncmod_python_gnc_module_init(int refcount)

+      }

+      g_free(init_filename);

+      g_free(pkgdatadir);

+ +    PyConfig_Clear(&config);

+  

+      return TRUE;

+  }

file modified
+5 -1
@@ -2,11 +2,12 @@ 

  Summary: Finance management application

  Version: 5.4

  URL: https://gnucash.org/

- Release: 2%{?dist}

+ Release: 3%{?dist}

  License: GPL-2.0-or-later

  Source: https://downloads.sourceforge.net/sourceforge/gnucash/gnucash-%{version}.tar.bz2

  

  Patch0: rpath.patch

+ Patch1: 1d8c525afc31ba3b02fcd86fb8dc1f484ead6c05.patch

  

  # https://bugzilla.redhat.com/show_bug.cgi?id=1563466

  ExcludeArch: ppc64 s390x
@@ -109,6 +110,9 @@ 

  %config(noreplace) %{_sysconfdir}/gnucash/*

  

  %changelog

+ * Mon Nov 27 2023 Gwyn Ciesla <gwync@protonmail.com> - 5.4-3

+ - Patch for Python 3.13

+ 

  * Fri Oct 27 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 5.4-2

  - Use guile30

  

no initial comment

Pull-Request has been merged by limb

7 months ago