user [email protected]
usertags 1145457 python3.15
tags 1145457 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].

Similarly to what Rafael mentioned, I also saw that applying upstream
patch: Replace PyString_FromString with PyUnicode_FromString for SWIG
4.5.0 compatibility (fb518ff492cd6a286f35b415cbd7fd0f6e3faedb) solves
this issue.

I've applied this fix in the sandbox [2] to verify that it builds
successfully, please consider applying it in Debian to get the package
back to a healthy state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4716983/
[2]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
From: Petr Lautrbach <[email protected]>
Date: Thu, 6 Aug 2026 16:30:44 +0200
Subject: libselinux: Replace PyString_FromString with PyUnicode_FromString for SWIG 4.5.0 compatibility

SWIG 4.5.0 removed Python 2 C API compatibility macros (PyInt_*,
PyString_*, SWIG_Python_str_*) from its runtime header pyhead.swg.
These macros previously mapped deprecated Python 2 C API names to their
Python 3 equivalents.

Fixes: https://github.com/SELinuxProject/selinux/issues/538
Authored-by: Jitka PlesnĂ­ková <[email protected]>
Signed-off-by: Petr Lautrbach <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
---
 src/selinuxswig_python.i | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: libselinux/src/selinuxswig_python.i
===================================================================
--- libselinux.orig/src/selinuxswig_python.i
+++ libselinux/src/selinuxswig_python.i
@@ -69,7 +69,7 @@ def install(src, dest):
 	PyObject* list = PyList_New(*$2);
 	int i;
 	for (i = 0; i < *$2; i++) {
-		PyList_SetItem(list, i, PyString_FromString((*$1)[i]));
+		PyList_SetItem(list, i, PyUnicode_FromString((*$1)[i]));
 	}
 	$result = SWIG_AppendOutput($result, list);
 }
@@ -102,7 +102,7 @@ def install(src, dest):
 			len++;
 		plist = PyList_New(len);
 		for (i = 0; i < len; i++) {
-			PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
+			PyList_SetItem(plist, i, PyUnicode_FromString((*$1)[i]));
 		}
 	} else {
 		plist = PyList_New(0);
@@ -119,7 +119,7 @@ def install(src, dest):
 	if (*$1) {
 		plist = PyList_New(result);
 		for (i = 0; i < result; i++) {
-			PyList_SetItem(plist, i, PyString_FromString((*$1)[i]));
+			PyList_SetItem(plist, i, PyUnicode_FromString((*$1)[i]));
 		}
 	} else {
 		plist = PyList_New(0);

Reply via email to