[PATCH] patches: upstream: python3.12 compat
Jing Luo
jing at jing.rocks
Tue Nov 12 20:06:16 CET 2024
Prepare for debian trixie. Upstream has not yet made a new release since
Dec 2023, backporting this commit to make ifupdown2 work on trixie. Also
fixes an RC bug on debian (#1074250). Also fixed a typo in the commit msg.
upstream: https://github.com/CumulusNetworks/ifupdown2/commit/fc0318378e878ffe639d1d1285936d1256dd67cf
Signed-off-by: Jing Luo <jing at jing.rocks>
---
debian/patches/series | 1 +
.../upstream/0001-python312-compat.patch | 27 +++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 debian/patches/upstream/0001-python312-compat.patch
diff --git a/debian/patches/series b/debian/patches/series
index 7ae3f0a..c14c181 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,3 +14,4 @@ upstream/0001-scheduler-import-traceback.patch
upstream/0001-addons-vxlan-fix-compare-between-remote-ips-and-old_.patch
upstream/0001-scheduler-avoid-waiting-for-stdout-eof-of-etc-networ.patch
upstream/0001-vxlan-fix-vni-filter.patch
+upstream/0001-python312-compat.patch
diff --git a/debian/patches/upstream/0001-python312-compat.patch b/debian/patches/upstream/0001-python312-compat.patch
new file mode 100644
index 0000000..c36482f
--- /dev/null
+++ b/debian/patches/upstream/0001-python312-compat.patch
@@ -0,0 +1,27 @@
+From fc0318378e878ffe639d1d1285936d1256dd67cf Mon Sep 17 00:00:00 2001
+From: Jan Huijsmans <huysmans at koffie.nu>
+Date: Tue, 9 Jul 2024 09:03:25 +0200
+Subject: [PATCH] Bug #296: python 3.12 compatibility
+
+Since python 3.2, readfp needs to be replaced by read_file.
+Python 3.12 dropped the readfp function.
+
+Patch provided as PR by me, as the original reporter failed to do
+so since 4-4-2024 and my systems break due to this issue.
+---
+ ifupdown2/ifupdown/main.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ifupdown2/ifupdown/main.py b/ifupdown2/ifupdown/main.py
+index 8e0f13f4..de6579ea 100644
+--- a/ifupdown2/ifupdown/main.py
++++ b/ifupdown2/ifupdown/main.py
+@@ -138,7 +138,7 @@ def read_config(self):
+ configStr = '[ifupdown2]\n' + config
+ configFP = io.StringIO(configStr)
+ parser = configparser.RawConfigParser()
+- parser.readfp(configFP)
++ parser.read_file(configFP)
+ configmap_g = dict(parser.items('ifupdown2'))
+
+ # Preprocess config map
--
2.47.0
More information about the pve-devel
mailing list