Hello!

While rebuilding the python related packages against Python 3.15rc2 we
stumbled on this FTBS.

In order to fix it I prepared a patch to solve the problem, basically
making sure that value are string and if they are not falling back to an
empty string. From my point of view this is the minimal change that
doesn't break the grammar, but you might want to forward this upstream
and discuss it with them.

As the failure has been around for quite a while and it breaks another
package (silkaj), I did an NMU with the attached changes. If you prefer
a different solution, please upload another version of the fix.

Happy hacking,

--
"I decry the current tendency to seek patents on algorithms. There are better ways to earn a living than to prevent other people from making use of one's contributions to computer science."
-- Donald Knuth
Saludos /\/\ /\ >< `/
diff --git a/debian/changelog b/debian/changelog
index 18bcc7e..f3f66d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+python-duniterpy (1.1.1-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+
+  [ Alexandre Detiste ]
+  * Apply multi-arch hints.  + python-duniterpy-doc: Add Multi-Arch: foreign.
+
+  [ Maximiliano Curia ]
+  * Ensure grammar classes initialize value attribute as string
+    (Closes: #1141006)
+
+ -- Maximiliano Curia <[email protected]>  Wed, 23 Sep 2026 17:15:05 +0200
+
 python-duniterpy (1.1.1-3) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/control b/debian/control
index b2e3fcc..e87fba3 100644
--- a/debian/control
+++ b/debian/control
@@ -54,6 +54,7 @@ Description: Duniter Python API - Python3 library
 
 Package: python-duniterpy-doc
 Architecture: all
+Multi-Arch: foreign
 Depends:
  ${sphinxdoc:Depends},
  ${misc:Depends},
diff --git a/debian/patches/Ensure-grammar-value-is-string.patch b/debian/patches/Ensure-grammar-value-is-string.patch
new file mode 100644
index 0000000..8559c62
--- /dev/null
+++ b/debian/patches/Ensure-grammar-value-is-string.patch
@@ -0,0 +1,54 @@
+Description: Ensure value attribute is string in grammar classes
+ In pypeg2, parsing passes a list of matched tokens to class __init__.
+ When value is a list, assigning it directly to self.value causes __str__
+ to return a list instead of str, raising TypeError.
+Forwarded: no
+Index: python-duniterpy/duniterpy/grammars/output.py
+===================================================================
+--- python-duniterpy.orig/duniterpy/grammars/output.py
++++ python-duniterpy/duniterpy/grammars/output.py
+@@ -61,7 +61,7 @@ class SIG:
+ 
+         :param value: Content of the string
+         """
+-        self.value = value
++        self.value = value if isinstance(value, str) else ""
+         self.pubkey = ""
+ 
+     def __str__(self) -> str:
+@@ -121,7 +121,7 @@ class CSV:
+ 
+         :param value: Content of the string
+         """
+-        self.value = value
++        self.value = value if isinstance(value, str) else ""
+         self.time = ""
+ 
+     def __str__(self) -> str:
+@@ -180,7 +180,7 @@ class CLTV:
+ 
+         :param value: Content of the string
+         """
+-        self.value = value
++        self.value = value if isinstance(value, str) else ""
+         self.timestamp = ""
+ 
+     def __str__(self) -> str:
+@@ -239,7 +239,7 @@ class XHX:
+ 
+         :param value: Content of the string
+         """
+-        self.value = value
++        self.value = value if isinstance(value, str) else ""
+         self.sha_hash = ""
+ 
+     def __str__(self) -> str:
+@@ -335,7 +335,7 @@ class Condition:
+ 
+         :param value: Content of the condition as string
+         """
+-        self.value = value
++        self.value = value if isinstance(value, str) else ""
+         self.left = ""  # type: Union[str, Condition]
+         self.right = ""  # type: Union[str, Condition]
+         self.op = ""  # type: Union[str, Condition]
diff --git a/debian/patches/series b/debian/patches/series
index d1c619f..4916c08 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 Fix-libnacl.version-import.patch
 Remove-empty-homepage-field-from-pyproject.patch
+Ensure-grammar-value-is-string.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to