Index | Thread | Search

From:
Sebastien Marie <semarie@kapouay.eu.org>
Subject:
patch: mail/offlineimap unbreak with recent python3
To:
ports@openbsd.org
Date:
Mon, 28 Jul 2025 04:31:18 +0200

Download raw body.

Thread
Hi,

The following diff unbreak mail/offlineimap at runtime.

it fixes a python exception "module importlib has no attribute 'machinery'"

it seems it brokes on last py3 update (somehow long time ago) and nobody
else noticed (I patched locally).

Comments or OK ?
-- 
Sebastien Marie

Commit ID: 7bdf22d51d5b2090e93911a47ccff00e72d17417
Change ID: rxlzrktmpzmsluswnzxwyqrvzkuqnnpy
Author   : Sebastien Marie <semarie@kapouay.eu.org> (2025-07-28 03:21:04)
Committer: Sebastien Marie <semarie@kapouay.eu.org> (2025-07-28 03:21:04)

    mail/offlineimap: patch for recent python3

diff --git a/mail/offlineimap/Makefile b/mail/offlineimap/Makefile
index 1d3016bb30..85c883927b 100644
--- a/mail/offlineimap/Makefile
+++ b/mail/offlineimap/Makefile
@@ -2,6 +2,7 @@
 
 MODPY_DISTV =	8.0.0
 DISTNAME =	offlineimap-${MODPY_DISTV}pl20240826
+REVISION =	0
 
 GH_ACCOUNT =	OfflineIMAP
 GH_PROJECT =	offlineimap3
diff --git a/mail/offlineimap/patches/patch-offlineimap_localeval_py b/mail/offlineimap/patches/patch-offlineimap_localeval_py
new file mode 100644
index 0000000000..e42204e00a
--- /dev/null
+++ b/mail/offlineimap/patches/patch-offlineimap_localeval_py
@@ -0,0 +1,14 @@
+https://github.com/OfflineIMAP/offlineimap3/pull/205
+
+Index: offlineimap/localeval.py
+--- offlineimap/localeval.py.orig
++++ offlineimap/localeval.py
+@@ -26,6 +26,8 @@ class LocalEval:
+         self.namespace = {}
+ 
+         if path is not None:
++            import importlib.machinery
++
+             # FIXME: limit opening files owned by current user with rights set
+             # to fixed mode 644.
+             importlib.machinery.SOURCE_SUFFIXES.append('') # empty string to allow any file