Reputation: 179
I am currently following a tutorial/getting started on creating a Google Talk Bot
I have made the EchoBot but it fails at runtime with the following error:
File "echobot.py", line 59, in <module>
if xmpp.connect(('talk.google.com'), '5222'):
File "C:\Python31\Lib\sleekxmpp\clientxmpp.py", line 143, in connect
reattempt=reattempt)
File "C:\Python31\Lib\sleekxmpp\xmlstream\xmlstream.py", line 372, in connect
self.address = (host, int(port))
ValueError: invalid literal for int() with base 10: 'a'
I have tried Python 3,3 , 3,2 and 3,1 interpreter with the same result.
I can not get these lines from the tutorial to compile with either of the compilers:
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf8')
The code from within the Bot where it fails is as follows:
if xmpp.connect(('talk.google.com'), '5222'):
xmpp.process(block=True)
else:
print('Fekk ikkje kopla til')
Thanks for any tips/help!
Upvotes: 0
Views: 1315
Reputation: 14863
You have written something wrong:
xmpp.connect(('talk.google.com', '5222'))
|
there you missed a comma
and the second thing could be to put the port to the second place.
xmpp.connect(('talk.google.com', 5222), '5222')
I do not know of the second argument but
Internet Adresses are almost always tuples of (HOST, PORT)
Upvotes: 2