From de29218bdbb03ed555425a5690c7b5197edd441b Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 13 Mar 2021 15:05:15 +0100 Subject: [PATCH] irclib: Make NestedCommandsIrcProxy._replyOverhead count in bytes instead of chars It was, once again, a bug to count characters, because they might contain multi-byte characters, and truncation happens after the 512th byte. --- src/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index d3f186a32..0f9741668 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -956,9 +956,9 @@ class NestedCommandsIrcProxy(ReplyIrcProxy): Ignores tag bytes, as they are accounted for separatly.""" overhead = ( len(':') - + len(self.irc.prefix) + + len(self.irc.prefix.encode()) + len(' PRIVMSG ') - + len(target) + + len(target.encode()) + len(' :') + len('\r\n') )