From 5805d5efccacb718f050a01bf29da191842965f9 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Wed, 7 Aug 2024 03:15:52 +0000 Subject: [PATCH] ...strip newlines from server messages. --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 09dbbe9..3e21ded 100755 --- a/server.py +++ b/server.py @@ -284,7 +284,7 @@ Please note that this is not network level statistics.\r\n""".encode( while 1: try: rawMsg = await asyncio.wait_for(reader.read(967), 0.1) - buffer = rawMsg.decode("utf8") + buffer = rawMsg.decode("utf8").strip() match buffer[0]: case "S": # Server notice G.msgs.extend([log(buffer[2:])]) @@ -473,7 +473,7 @@ async def connectServer(hostname: str, port: int): while 1: try: rawMsg = await asyncio.wait_for(reader.read(1024), 0.1) - buffer = rawMsg.decode("utf8") + buffer = rawMsg.decode("utf8").strip() match buffer[0]: case "S": G.msgs.extend([log(buffer[2:])])