Forgot the debdiff.
diff -Nru policyd-rate-limit-1.2.0/debian/changelog 
policyd-rate-limit-1.2.0/debian/changelog
--- policyd-rate-limit-1.2.0/debian/changelog   2025-04-07 00:11:36.000000000 
+0200
+++ policyd-rate-limit-1.2.0/debian/changelog   2026-02-24 14:55:00.000000000 
+0100
@@ -1,3 +1,10 @@
+policyd-rate-limit (1.2.0-1.1+deb13u1) trixie; urgency=medium
+
+  * Team upload.
+  * Apply patch from Borut Mrak for python 3.12. Closes: #1128265.
+
+ -- Santiago Vila <[email protected]>  Tue, 24 Feb 2026 14:55:00 +0100
+
 policyd-rate-limit (1.2.0-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru policyd-rate-limit-1.2.0/debian/gbp.conf 
policyd-rate-limit-1.2.0/debian/gbp.conf
--- policyd-rate-limit-1.2.0/debian/gbp.conf    2021-09-16 04:59:51.000000000 
+0200
+++ policyd-rate-limit-1.2.0/debian/gbp.conf    1970-01-01 01:00:00.000000000 
+0100
@@ -1,2 +0,0 @@
-[DEFAULT]
-debian-branch=debian/master
diff -Nru policyd-rate-limit-1.2.0/debian/patches/python-3.12.patch 
policyd-rate-limit-1.2.0/debian/patches/python-3.12.patch
--- policyd-rate-limit-1.2.0/debian/patches/python-3.12.patch   1970-01-01 
01:00:00.000000000 +0100
+++ policyd-rate-limit-1.2.0/debian/patches/python-3.12.patch   2026-02-24 
13:02:00.000000000 +0100
@@ -0,0 +1,54 @@
+From 1fb4701628f844eca0f73f29b502457d4b7e4d3c Mon Sep 17 00:00:00 2001
+From: Borut Mrak <[email protected]>
+Date: Thu, 5 Jun 2025 21:16:59 +0200
+Subject: replace the imp library import for compatibility with python 3.12+
+
+--- a/policyd_rate_limit/utils.py
++++ b/policyd_rate_limit/utils.py
+@@ -15,7 +15,8 @@
+ import collections
+ import ipaddress
+ import time
+-import imp
++import importlib.util
++import importlib.machinery
+ import pwd
+ import grp
+ import warnings
+@@ -35,6 +36,18 @@
+         return ipaddress.IPv6Network(ip_str)
+ 
+ 
++
++def load_source(modname, filename):
++    # Replacing imp.load_source() according to 
https://docs.python.org/3/whatsnew/3.12.html#imp
++    loader = importlib.machinery.SourceFileLoader(modname, filename)
++    spec = importlib.util.spec_from_file_location(modname, filename, 
loader=loader)
++    module = importlib.util.module_from_spec(spec)
++    # The module is always executed and not cached in sys.modules.
++    # Uncomment the following line to cache the module.
++    # sys.modules[module.__name__] = module
++    loader.exec_module(module)
++    return module
++
+ class Exit(Exception):
+     pass
+ 
+@@ -63,7 +76,7 @@
+                 try:
+                     # compatibility with old config style in a python module
+                     if config_file.endswith(".conf"):  # pragma: no cover 
(deprecated)
+-                        self._config = imp.load_source('config', config_file)
++                        self._config = load_source('config', config_file)
+                         warnings.warn(
+                             (
+                                 "New configuration use a .yaml file. "
+@@ -71,7 +84,7 @@
+                             ),
+                             stacklevel=3
+                         )
+-                        cache_file = imp.cache_from_source(config_file)
++                        cache_file = 
importlib.util.cache_from_source(config_file)
+                         # remove the config pyc file
+                         try:
+                             os.remove(cache_file)
diff -Nru policyd-rate-limit-1.2.0/debian/patches/series 
policyd-rate-limit-1.2.0/debian/patches/series
--- policyd-rate-limit-1.2.0/debian/patches/series      2021-09-16 
04:59:51.000000000 +0200
+++ policyd-rate-limit-1.2.0/debian/patches/series      2026-02-24 
13:00:00.000000000 +0100
@@ -1 +1,2 @@
 ignore-init-service.patch
+python-3.12.patch

Reply via email to