Package: src:python-txi2p-tahoe
Version: 0.3.7-5
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important
Hi!
While rebuilding the python related packages against the Python 3.15rc2
version we found that python-txi2p-tahoe fails to build from source [1].
The error is:
TypeError: ParserProtocol.__init__() takes 5 positional arguments but 6 were
given
This happens because functools.partial is now an object, and the way the
code is used causes Python to add a `self` parameter that shouldn't be
there.
I've prepared a patch that drops the use of functools.partial, it wasn't
actually needed. This patch should probably be forwarded upstream.
I've applied the fix in the sandbox [2] to verify that it builds
successfully, please consider applying the patch to support the upcoming
3.15 version.
Setting the severity to important for now. Once Python 3.15 is released,
it will be added to python3-defaults and this bug will become release
critical.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4455091/
[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 /\/\ /\ >< `/
Description: Avoid functools.partial as class attribute in Python 3.14+
Forwarded: no
Index: python-txi2p-tahoe/txi2p/bob/protocol.py
===================================================================
--- python-txi2p-tahoe.orig/txi2p/bob/protocol.py
+++ python-txi2p-tahoe/txi2p/bob/protocol.py
@@ -5,7 +5,8 @@ from __future__ import print_function
from builtins import range
from builtins import object
import os
-from parsley import makeProtocol
+from ometa.grammar import OMeta
+from ometa.protocol import ParserProtocol
from twisted.internet.error import ConnectError, UnknownHostError
from twisted.internet.interfaces import IListeningPort
from twisted.internet.protocol import Protocol
@@ -398,22 +399,25 @@ class I2PTunnelRemoverBOBReceiver(BOBRec
print('clear ERROR: %s ' % info)
+def makeBOBProtocol(receiverFactory):
+ g = OMeta(grammar.bobGrammarSource).parseGrammar('Grammar')
+ class BOBProtocol(ParserProtocol):
+ def __init__(self):
+ ParserProtocol.__init__(
+ self, g, BOBSender, receiverFactory, {})
+ return BOBProtocol
+
+
# A Protocol for making an I2P client tunnel via BOB
-I2PClientTunnelCreatorBOBClient = makeProtocol(
- grammar.bobGrammarSource,
- BOBSender,
+I2PClientTunnelCreatorBOBClient = makeBOBProtocol(
I2PClientTunnelCreatorBOBReceiver)
# A Protocol for making an I2P server tunnel via BOB
-I2PServerTunnelCreatorBOBClient = makeProtocol(
- grammar.bobGrammarSource,
- BOBSender,
+I2PServerTunnelCreatorBOBClient = makeBOBProtocol(
I2PServerTunnelCreatorBOBReceiver)
# A Protocol for removing a BOB I2P tunnel
-I2PTunnelRemoverBOBClient = makeProtocol(
- grammar.bobGrammarSource,
- BOBSender,
+I2PTunnelRemoverBOBClient = makeBOBProtocol(
I2PTunnelRemoverBOBReceiver)
Index: python-txi2p-tahoe/txi2p/sam/base.py
===================================================================
--- python-txi2p-tahoe.orig/txi2p/sam/base.py
+++ python-txi2p-tahoe/txi2p/sam/base.py
@@ -69,8 +69,11 @@ class SAMParserProtocol(ParserProtocol):
def makeSAMProtocol(senderFactory, receiverFactory):
g = OMeta(grammar.samGrammarSource).parseGrammar('Grammar')
- return functools.partial(
- SAMParserProtocol, g, senderFactory, receiverFactory, {})
+ class SAMProtocol(SAMParserProtocol):
+ def __init__(self):
+ SAMParserProtocol.__init__(
+ self, g, senderFactory, receiverFactory, {})
+ return SAMProtocol
class SAMSender(object):