home
·
contact
·
privacy
projects
/
plomlombot-irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b3ac1e
)
In recv_line(), handle UnicodeDecodeErrors by assuming latin1.
author
Christian Heller
<c.heller@plomlompom.de>
Mon, 18 Jan 2016 21:40:36 +0000
(22:40 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Mon, 18 Jan 2016 21:40:36 +0000
(22:40 +0100)
plomlombot.py
patch
|
blob
|
history
diff --git
a/plomlombot.py
b/plomlombot.py
index 81be31fdb5f438349469e7d63afac9b4b20b1a7e..0b605e9946b04f79a8f3e843da56eee2b59b0169 100755
(executable)
--- a/
plomlombot.py
+++ b/
plomlombot.py
@@
-67,7
+67,11
@@
class IO:
self._pingtest(send_ping)
return None
self.last_pong = time.time()
- received_runes = self.socket.recv(1024).decode("UTF-8")
+ received_bytes = self.socket.recv(1024)
+ try:
+ received_runes = received_bytes.decode("UTF-8")
+ except UnicodeDecodeError:
+ received_runes = received_bytes.decode("latin1")
if len(received_runes) == 0:
print("SOCKET CONNECTION BROKEN")
raise ExceptionForRestart