bitvavo / python-bitvavo-api

Python wrapper for the Bitvavo API
https://pypi.org/project/python-bitvavo-api/
ISC License
38 stars 25 forks source link

Websocket issues. #9

Closed j-wilhelm closed 3 years ago

j-wilhelm commented 3 years ago

When using the websocket connections in Python, several errors keep appearing. Since these are not dealt with, this results in a break maximum recursion depth error.

See the following sequence: error from callback <bound method Bitvavo.websocket.on_error of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C0ADD8>>: name 'callbacks' is not defined error from callback <bound method Bitvavo.websocket.on_close of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C0ADD8>>: 'receiveThread' object has no attribute 'exit' error from callback <bound method Bitvavo.websocket.on_error of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C15240>>: name 'callbacks' is not defined error from callback <bound method Bitvavo.websocket.on_close of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C15240>>: 'receiveThread' object has no attribute 'exit' error from callback <bound method Bitvavo.websocket.on_error of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9AF3F60>>: name 'callbacks' is not defined error from callback <bound method Bitvavo.websocket.on_close of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9AF3F60>>: 'receiveThread' object has no attribute 'exit' error from callback <bound method Bitvavo.websocket.on_error of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C1AB70>>: name 'callbacks' is not defined error from callback <bound method Bitvavo.websocket.on_close of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x0000001AD9C1AB70>>: 'receiveThread' object has no attribute 'exit'

And: error from callback <bound method Bitvavo.websocket.on_message of <python_bitvavo_api.bitvavo.Bitvavo.websocket object at 0x000000C9D7123BA8>>: 'websocket' object has no attribute 'makeLocalBook'

The latter occurs on line 84. ws does indeed not have an attribute or method called makeLocalBook. The first two also make sense; threading.Thread has no attribute or method called exit (in the on_close method). And 'callbacks' randomly appears in the on_error method.

This results in a loop of errors the application cannot get out of. It finally breaks my program which is fairly annoying.

rroumenov commented 3 years ago

@j-wilhelm Bro, check out this pull request. Maybe will helps you:

https://github.com/bitvavo/python-bitvavo-api/pull/6#issue-565871226

joeri-vv commented 3 years ago

There were indeed issues with the websocket, which are fixed in the newest version available on pypi: 1.2.2:

pip3 install python-bitvavo-api==1.2.2

This should also fix your issues, please open another issue if this is not the case. Thanks for the pointers!