coinbasepro-python icon indicating copy to clipboard operation
coinbasepro-python copied to clipboard

'NoneType' object has no attribute 'join'

Open Cristianistrate opened this issue 5 years ago • 2 comments

on example: import cbpro

Parameters are optional

wsClient = cbpro.WebsocketClient(url="wss://ws-feed.pro.coinbase.com", products="BTC-USD", channels=["ticker"])

Do other stuff...

wsClient.close()

i get this error:

File "C:\Python3\lib\site-packages\cbpro\websocket_client.py", line 104, in close self.thread.join() AttributeError: 'NoneType' object has no attribute 'join'

Please advise

Cristianistrate avatar Dec 27 '20 07:12 Cristianistrate

I am also having this issue. Have you found a fix yet or are we waiting for someone to help still? Thanks!

jchapman0511 avatar Jan 13 '21 00:01 jchapman0511

This is occurring as you have not yet started listening. You must first call .start() before calling .close()

Example Usage:

import cbpro
wsClient = cbpro.WebsocketClient(url="wss://ws-feed.pro.coinbase.com",
                                 products=["BTC-USD"],
                                 channels=["ticker"])

wsClient.start()

#  Do stuff here, sleeping for example
time.sleep(10)

wsClient.close()

ElliotSknr avatar Feb 21 '21 12:02 ElliotSknr