I am doing the tutorial at
http://brbx.com/orbited/tutorials/python_intro.html
When I run the python commands to issue an event, I get the following
error:
/sw/lib/python2.5/site-packages/pyorbited-0.1.1-py2.5.egg/pyorbited/
simple.py:59: DeprecationWarning: raising a string exception is
deprecated
raise "ConnectionLost"
Traceback (most recent call last):
File "test.py", line 5, in <module>
client.event([user_key], headers, False)
File "build/bdist.macosx-10.4-i386/egg/pyorbited/simple.py", line
62, in event
File "build/bdist.macosx-10.4-i386/egg/pyorbited/simple.py", line
32, in reconnect
File "build/bdist.macosx-10.4-i386/egg/pyorbited/simple.py", line
28, in disconnect
AttributeError: 'NoneType' object has no attribute 'close'
It appears that the socket is unexpectedly 'None', so I decided to
place a print statement in the connect method of the Client class like
so:
def
connect(self):
...
self.socket = io.client_socket(self.addr,
self.port)
self.socket.setblocking(1)
print self.socket
Running the example again, it worked, printing out a representation of
the socket object and sending data to the browser!
What is causing this error, and how is a single print statement fixing
it? I think it has something to do with blocking but I don't
understand what's going on. Thanks!