add error handling for broken unicode

This commit is contained in:
iou1name 2019-09-13 19:01:08 -04:00
parent 03eea368c3
commit 180cb159a7

7
bot.py
View File

@ -616,6 +616,13 @@ class Fulvia(irc.IRCClient):
self.whoisIdle(nick, idle, signon)
def lineReceived(self, line):
"""Overridden to fix broken unicode issues."""
if bytes != str and isinstance(line, bytes):
line = line.decode('utf-8', errors='surrogateescape')
super().lineReceived(line)
class FulviaWrapper():
"""
A wrapper class for Fulvia to provide default destinations for msg