mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-30 23:09:23 +01:00
Irc: catch UnicodeDecodeError when parsing lines
TODO: respect other encodings too?
This commit is contained in:
parent
4d7d7ce428
commit
ce822061d2
3
main.py
3
main.py
@ -127,7 +127,8 @@ class Irc():
|
|||||||
while b'\n' in buf:
|
while b'\n' in buf:
|
||||||
line, buf = buf.split(b'\n', 1)
|
line, buf = buf.split(b'\n', 1)
|
||||||
line = line.strip(b'\r')
|
line = line.strip(b'\r')
|
||||||
line = line.decode("utf-8")
|
# TODO: respect other encodings?
|
||||||
|
line = line.decode("utf-8", "replace")
|
||||||
log.debug("(%s) <- %s", self.name, line)
|
log.debug("(%s) <- %s", self.name, line)
|
||||||
hook_args = None
|
hook_args = None
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user