add error handling for broken unicode
This commit is contained in:
parent
03eea368c3
commit
180cb159a7
7
bot.py
7
bot.py
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user