Package: sigil
Version: 2.0.1+dfsg1-1
Severity: normal
Tags: sid

Hi!

A bit of a heads-up / pre-emptive bug reporting.

Due to a rather poorly documented API change in Python's ctypes module in 3.12.0a4 and newer, Sigil versions less than the yet to be released 2.1.0 exhibit broken plugin support when running using Python 3.12 as their interpreter.

The issue was identified and is currently fixed in upstream master, in a manner backwards compatible with all Python versions.

Details on the cause of the problem in this upstream Github issue: https://github.com/Sigil-Ebook/Sigil/issues/741

Fix in this upstream pull request: https://github.com/Sigil-Ebook/Sigil/pull/742

with the two fixing commits also attached as a patch to this bug report (I'm the PR author, if it matters in any way for accountability etc reasons.)

Hope this wasn't redundant! While 3.12 isn't yet the default Python in sid, I'm not familiar with the release timing. Sigil 2.1.0 is estimated to release after the end of March, so if sid switches /usr/bin/python3 (Sigil's default auto-detected interpreter path) to python3.12 before Sigil 2.1.0 is imported, it'll result in broken plugins.

Thanks!
diff --git a/src/Resource_Files/plugin_launchers/python/pluginhunspell.py b/src/Resource_Files/plugin_launchers/python/pluginhunspell.py
index 341b434ed..2ef52a804 100644
--- a/src/Resource_Files/plugin_launchers/python/pluginhunspell.py
+++ b/src/Resource_Files/plugin_launchers/python/pluginhunspell.py
@@ -47,7 +47,7 @@ class HunspellChecker(object):
         try:
             # First use bundled hunspell location.
             self.hunspell = cdll[hunspell_dllpath]
-        except OSError:
+        except (OSError, AttributeError):
             # No bundled (or incompatible bundled) libhunspell found.
             # found. So search for system libhunspell.
             self.hunspell = None
diff --git a/src/Resource_Files/plugin_launchers/python/pluginhunspellml.py b/src/Resource_Files/plugin_launchers/python/pluginhunspellml.py
index c7ce8a981..aa5378726 100644
--- a/src/Resource_Files/plugin_launchers/python/pluginhunspellml.py
+++ b/src/Resource_Files/plugin_launchers/python/pluginhunspellml.py
@@ -62,7 +62,7 @@ class HunspellMLChecker(object):
         try:
             # First use bundled hunspell location.
             self.hunspell = cdll[hunspell_dllpath]
-        except OSError:
+        except (OSError, AttributeError):
             # No bundled (or incompatible bundled) libhunspell found.
             # found. So search for system libhunspell.
             self.hunspell = None

Reply via email to