Bug#1059657: circuits: autopkgtest failure with Python 3.12

2024-01-05 Thread Yogeswaran Umasankar

Hi,
Made a patch to fix the autopkgtest issue with Py 3.12. Attaching the
debdiff file.
Cheers!
diff -Nru circuits-3.2.2/debian/changelog circuits-3.2.2/debian/changelog
--- circuits-3.2.2/debian/changelog 2022-12-14 16:15:09.0 +
+++ circuits-3.2.2/debian/changelog 2024-01-06 01:27:18.0 +
@@ -1,3 +1,11 @@
+circuits (3.2.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer/Team upload. (Closes: #1059657)
+  * Included a patch for /circuits/core/utils.py to replace
+deprecated imp with importlib to fix autopkgtest in Py3.12.
+
+ -- Yogeswaran Umasankar   Sat, 06 Jan 2024 01:27:18 +
+
 circuits (3.2.2-1) unstable; urgency=medium
 
   * New upstream version 3.2.2 (Closes: #1024860)
diff -Nru circuits-3.2.2/debian/patches/06_replace-imp-with-importlib.patch 
circuits-3.2.2/debian/patches/06_replace-imp-with-importlib.patch
--- circuits-3.2.2/debian/patches/06_replace-imp-with-importlib.patch   
1970-01-01 00:00:00.0 +
+++ circuits-3.2.2/debian/patches/06_replace-imp-with-importlib.patch   
2024-01-06 01:21:32.0 +
@@ -0,0 +1,27 @@
+Description: Implemented importlib to fix autopkgtest failure with Python 3.12.
+Author: Yogeswaran Umasankar 
+Last-Update: 2024-01-06
+
+--- a/circuits/core/utils.py
 b/circuits/core/utils.py
+@@ -3,7 +3,7 @@
+ This module defines utilities used by circuits.
+ """
+ import sys
+-from imp import reload
++import importlib
+ 
+ 
+ def flatten(root, visited=None):
+@@ -53,9 +53,9 @@ def safeimport(name):
+ modules = sys.modules.copy()
+ try:
+ if name in sys.modules:
+-return reload(sys.modules[name])
++return importlib.reload(sys.modules[name])
+ else:
+-return __import__(name, globals(), locals(), [""])
++return importlib.import_module(name)
+ except Exception:
+ for name in sys.modules.copy():
+ if name not in modules:
diff -Nru circuits-3.2.2/debian/patches/series 
circuits-3.2.2/debian/patches/series
--- circuits-3.2.2/debian/patches/series2022-12-14 16:15:09.0 
+
+++ circuits-3.2.2/debian/patches/series2024-01-06 01:15:42.0 
+
@@ -2,3 +2,4 @@
 03_disable-address-check.patch
 04_remove-google-adsense.patch
 05_remove-privacy-breach-badges.patch
+06_replace-imp-with-importlib.patch


signature.asc
Description: PGP signature


Bug#1059657: circuits: autopkgtest failure with Python 3.12

2023-12-29 Thread Graham Inggs
Source: circuits
Version: 3.2.2-1
Severity: serious
Tags: sid trixie
User: debian-pyt...@lists.debian.org
Usertags: python3.12

Hi Maintainer

circuits' autopkgtests fail with Python 3.12 [1].  I've copied what I
hope is the relevant part of the log below.

Regards
Graham


[1] https://ci.debian.net/packages/c/circuits/testing/amd64/


37s autopkgtest [08:06:44]: test autodep8-python3: [---
37s Testing with python3.12:
37s Traceback (most recent call last):
37s File "", line 1, in 
37s File "/usr/lib/python3/dist-packages/circuits/__init__.py", line
20, in 
37s from .core import (
37s File "/usr/lib/python3/dist-packages/circuits/core/__init__.py",
line 10, in 
37s from .loader import Loader
37s File "/usr/lib/python3/dist-packages/circuits/core/loader.py",
line 11, in 
37s from .utils import safeimport
37s File "/usr/lib/python3/dist-packages/circuits/core/utils.py", line
6, in 
37s from imp import reload
37s ModuleNotFoundError: No module named 'imp'
37s autopkgtest [08:06:44]: test autodep8-python3: ---]