From d1758db4e7bca50931a2405b4dd8c71085cc5e20 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 11 Oct 2012 14:49:02 -0400 Subject: [PATCH] Emergency fix for IRC library bug. --- irkerd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/irkerd b/irkerd index a78a1fe..1e07a86 100755 --- a/irkerd +++ b/irkerd @@ -364,7 +364,7 @@ class Irker: self.irc.add_global_handler("featurelist", self._handle_features) self.irc.add_global_handler("disconnect", self._handle_disconnect) self.irc.add_global_handler("kick", self._handle_kick) - thread = threading.Thread(target=self.irc.process_forever) + thread = threading.Thread(target=self.process_forever) thread.setDaemon(True) self.irc._thread = thread thread.start() @@ -376,6 +376,16 @@ class Irker: "Debugging information." if self.debuglevel >= level: sys.stderr.write("irkerd: %s\n" % errmsg) + def process_forever(self, timeout=0.2): + "Shim - can be removed later." + # Kluge to get around the fact that 3.2 and older library + # versions do a Unicode decode where they shouldn't. + self.debug(1, "process_forever(timeout=%s)" % timeout) + while True: + try: + self.irc.process_once(timeout) + except UnicodeDecodingError: + pass def _handle_ping(self, connection, _event): "PING arrived, bump the last-received time for the connection." if connection.context: -- 2.26.2