TypeError: onclose() takes exactly 2 arguments (3 given)
Created by: staticfloat
Using the example code, when a browser closes the websocket, I get the following error:
Connection opened at 127.0.0.1:62101
Traceback (most recent call last):
File "websocket_test.py", line 23, in <module>
EchoConnection(client).receive_forever()
File "C:\Python27\lib\site-packages\wspy\connection.py", line 142, in receive_forever
self.close(e.code, e.reason)
File "C:\Python27\lib\site-packages\wspy\connection.py", line 202, in close
self.onclose(code, reason)
TypeError: onclose() takes exactly 2 arguments (3 given)
I fixed this by changing line 202 of connection.py to self.onclose(reason)
Imported comments:
By taddeus on 2014-01-07 16:40:20 UTC
This is an error in the example code. It should be "def onclose(self, code, reason):" I updated the README with working code. Thanks for reporting the error!