[pychess] push by gbtami - Python3 fix in engine chat on 2015-01-16 22:40 GMT

2 views
Skip to first unread message

pyc...@googlecode.com

unread,
Jan 16, 2015, 5:40:34 PM1/16/15
to pychess...@googlegroups.com
Revision: d412ecfda879
Branch: default
Author: gbtami
Date: Fri Jan 16 22:07:57 2015 UTC
Log: Python3 fix in engine chat
https://code.google.com/p/pychess/source/detail?r=d412ecfda879

Modified:
/lib/pychess/Players/Engine.py
/lib/pychess/Players/PyChessFICS.py

=======================================
--- /lib/pychess/Players/Engine.py Tue Dec 30 17:16:47 2014 UTC
+++ /lib/pychess/Players/Engine.py Fri Jan 16 22:07:57 2015 UTC
@@ -110,7 +110,7 @@
def answer (message):
try:
data =
urlopen("http://www.pandorabots.com/pandora/talk?botid=8d034368fe360895",
-
urlencode({"message":message, "botcust2":"x"})).read()
+
urlencode({"message":message, "botcust2":"x"}).encode("utf-8")).read().decode('utf-8')
except IOError as e:
log.warning("Couldn't answer message from online
bot: '%s'" % e,
extra={"task":self.defname})
=======================================
--- /lib/pychess/Players/PyChessFICS.py Tue Dec 30 17:16:47 2014 UTC
+++ /lib/pychess/Players/PyChessFICS.py Fri Jan 16 22:07:57 2015 UTC
@@ -272,7 +272,7 @@
else:
def onlineanswer (message):
data =
urlopen("http://www.pandorabots.com/pandora/talk?botid=8d034368fe360895",
-
urlencode({"message":message, "botcust2":"x"})).read()
+
urlencode({"message":message, "botcust2":"x"}).encode("utf-8")).read().decode('utf-8')
ss = "<b>DMPGirl:</b>"
es = "<br>"
answer = data[data.find(ss)+len(ss) :
data.find(es,data.find(ss))]
Reply all
Reply to author
Forward
0 new messages