From bd058a96e094c1dc980e6db3599eff29030143e0 Mon Sep 17 00:00:00 2001 From: f321x Date: Thu, 13 Nov 2025 22:46:30 +0100 Subject: [PATCH 1/3] use logger.warning instead of logger.warn fixes DeprecationWarning, logger.warn is not supported anymore. --- connectrum/client.py | 2 +- connectrum/findall.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connectrum/client.py b/connectrum/client.py index 6da08fd..430e4db 100644 --- a/connectrum/client.py +++ b/connectrum/client.py @@ -59,7 +59,7 @@ def _connection_lost(self, protocol): return self.protocol = None - logger.warn("Electrum server connection lost") + logger.warning("Electrum server connection lost") for (_, fut) in self.inflight.values(): fut.set_exception(ElectrumErrorResponse("Electrum server connection lost")) diff --git a/connectrum/findall.py b/connectrum/findall.py index c19a5c1..b6ef9cc 100644 --- a/connectrum/findall.py +++ b/connectrum/findall.py @@ -109,7 +109,7 @@ async def reconnect(self, **kwargs): # Trigger an event that may cascade to a client_connect. # Don't continue until a client_connect occurs, which may be never. - logger.warn("Disconnected (will reconnect)") + logger.warning("Disconnected (will reconnect)") # Note that we're not in a coroutine, so we don't have access # to await and asyncio.sleep From c5076c3bc57bde815b23220ab47f4cefaaa2f2c9 Mon Sep 17 00:00:00 2001 From: f321x Date: Thu, 13 Nov 2025 22:48:11 +0100 Subject: [PATCH 2/3] git: add .idea to .gitignore file ignores env files created by JetBrains IDEs --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 970302f..a366949 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ pp dist build connectrum.egg-info +.idea \ No newline at end of file From 280f30e928a3e81927d6c62596dcee94a0c8ca64 Mon Sep 17 00:00:00 2001 From: f321x Date: Thu, 13 Nov 2025 22:50:39 +0100 Subject: [PATCH 3/3] protocol: fix LookupError exception fixes: ``` Traceback (most recent call last): File "uvloop/sslproto.pyx", line 711, in uvloop.loop.SSLProtocol._do_read File "uvloop/sslproto.pyx", line 791, in uvloop.loop.SSLProtocol._do_read__copied File "/home/user/code/connectrum-fork/connectrum/protocol.py", line 36, in data_received msg = line.decode('utf-8', "error").strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ LookupError: unknown error handler name 'error' ``` --- connectrum/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectrum/protocol.py b/connectrum/protocol.py index 5e06955..9f05436 100644 --- a/connectrum/protocol.py +++ b/connectrum/protocol.py @@ -33,7 +33,7 @@ def data_received(self, data): if not line: continue try: - msg = line.decode('utf-8', "error").strip() + msg = line.decode('utf-8', "strict").strip() except UnicodeError as exc: logger.exception("Encoding issue on %r" % line) self.connection_lost(exc)