public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ldns] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Tue, 11 Aug 2026 08:01:18 GMT	[thread overview]
Message-ID: <178643527834.1.9506532869513112858.rpms-ldns-7aa3fd2d7a1b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/ldns
Branch : rawhide
Commit : 7aa3fd2d7a1b3b57cf837303979dfaa016cfef47
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date   : 2026-07-28T15:29:18+02:00
Stats  : +25/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ldns/c/7aa3fd2d7a1b3b57cf837303979dfaa016cfef47?branch=rawhide

Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility

---
diff --git a/ldns-swig45.patch b/ldns-swig45.patch
new file mode 100644
index 0000000..1e5e983
--- /dev/null
+++ b/ldns-swig45.patch
@@ -0,0 +1,21 @@
+diff -up ldns-1.9.2/contrib/python/ldns.i.swig45 ldns-1.9.2/contrib/python/ldns.i
+--- ldns-1.9.2/contrib/python/ldns.i.swig45	2026-07-28 12:30:04.741529232 +0200
++++ ldns-1.9.2/contrib/python/ldns.i	2026-07-28 12:33:31.997732285 +0200
+@@ -151,7 +151,7 @@ int Python_str_Check(PyObject *o) {
+ #if PY_VERSION_HEX>=0x03000000
+   return PyUnicode_Check(o);
+ #else
+-  return PyString_Check(o);
++  return PyBytes_Check(o);
+ #endif
+ }
+ %}
+@@ -414,7 +414,7 @@ PyObject* ldns_pkt2wire_(const ldns_pkt
+   tuple = PyTuple_New(2);
+   PyTuple_SetItem(tuple, 0, SWIG_From_int(result));
+   if (result == LDNS_STATUS_OK)
+-     PyTuple_SetItem(tuple, 1, SWIG_FromCharPtrAndSize((char *)arg1, arg3));
++     PyTuple_SetItem(tuple, 1, PyUnicode_FromStringAndSize((char *)arg1, arg3));
+   else {
+      Py_INCREF(Py_None);
+      PyTuple_SetItem(tuple, 1, Py_None);

diff --git a/ldns.spec b/ldns.spec
index e722d25..63d67df 100644
--- a/ldns.spec
+++ b/ldns.spec
@@ -44,6 +44,10 @@ Patch1: ldns-1.7.0-multilib.patch
 # https://github.com/NLnetLabs/ldns/pull/288
 Patch8: ldns-1.9-std23-bool.patch
 
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch9: ldns-swig45.patch
+
 BuildRequires: libtool
 BuildRequires: autoconf
 BuildRequires: automake

                 reply	other threads:[~2026-08-11  8:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178643527834.1.9506532869513112858.rpms-ldns-7aa3fd2d7a1b@fedoraproject.org \
    --to=jplesnik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox