-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Crashes at the end of websocket Implementation #29
Comments
Hello @yogamurthy -- Thanks for letting us know. Would you please share with us the environment details as well as the fill script you are running? Thanks! |
OS: Windows 7 The following is the complete script im using now import GDAX, time wsClient = myWebsocketClient() |
Hi @yogamurthy - Firstly, I would like to state I did not encounter this issue on my current Python interpreters, but I will do my best to help you out given the information on hand. Under initial inspection of your script, it seems as though you are missing the last line here: wsClient.close() ...but you said it exits with the 'Goodbye!' message, so I'm going to assume you have this line. Additionally, it would be better practice to change the onMessage method to the code following. While it didn't change the behavior, it might be a better way to implement a fix to your issue. The message count & close logic was to show how you might share variables between threads so feel free to modify this to suit your needs. self.MessageCount += 1
if self.MessageCount >= 100 and 'type' in msg:
print("Message type:", msg) Please let me know if you have any additional questions! |
I have been getting a similar issue on my mac |
Hi @jwlondon98 thank you for sharing your issue! Hopefully we can get this cleared up ASAP. Did the fixes above work? Are you getting the same error? What version of the project are you running? |
My scripts have also been crashing near the end of any implementations of WebsocketClient. If we join to the second thread after self.stop = True,but before self.ws.close(), the websocket connection can't close while the secondary thread is running. In def close(self) of WebsocketClient.py: Proposed code: |
This has been implemented in the most recent update to PyPI @yogamurthy I will be closing this out within the next week -- please let us know if you encounter the same error with these changes. |
I have noticed that "python crashed. windows is collecting information" constantly in Windows environment.
The program perfectly finishes and says goodbye, then python crashes with exit code 255
same crash on both 2.7 and 3.6
I modified the code a bit to avoid tihs error,
The last 2 lines are added in my program and it solved the issue.
The text was updated successfully, but these errors were encountered: