From 95ad79b5ec88cb6d6da5fbe87b169abee04cba01 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Fri, 23 Sep 2011 19:31:48 -0400 Subject: [PATCH] attempt to fix intermittent disconnections due to AttributeError when decoding --- bot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot.py b/bot.py index 21ba4ab..1054797 100755 --- a/bot.py +++ b/bot.py @@ -22,6 +22,8 @@ def decode(bytes): text = bytes.decode('iso-8859-1') except UnicodeDecodeError: text = bytes.decode('cp1252') + except AttributeError: + return bytes return text class Phenny(irc.Bot):