-
-
Notifications
You must be signed in to change notification settings - Fork 164
Bug fix #142
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
Bug fix #142
Conversation
unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 1300, in create_websocket_uri elif "!" in market: UnboundLocalError: local variable 'market' referenced before assignment
unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 1300, in create_websocket_uri elif "!" in market: UnboundLocalError: local variable 'market' referenced before assignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @gronastech!
- How can I reproduce the error?
- Please dont change the version numbers! The last release has the version 1.28.0. As soon as a change is committed on github, it becomes 1.28.0.dev - only when a release is created, it becomes 1.29.0 or 1.28.1.
Best regards,
Oliver
sphinx/source/conf.py
Outdated
@@ -27,7 +27,7 @@ | |||
# The short X.Y version | |||
version = '' | |||
# The full version, including alpha/beta/rc tags | |||
release = '1.28.0' | |||
release = '1.28.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change that! This is done during the build of the package!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @gronastech!
- How can I reproduce the error?
Best regards,
Oliver
Such issues appear when socket restart initiated (abnormal connection closed, etc - any reason). And at the same time markets was empty - without a subscription to exact trade pairs, just open depth channel.
You have typical issue across the code when you don't check that key exists in the dictionary and trying to open it directly.
The same issue appeared for !userData channel:
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/lordserenity/.local/lib/python3.8/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 433, in _create_stream_thread
loop.run_until_complete(socket.start_socket())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/lordserenity/.local/lib/python3.8/site-packages/unicorn_binance_websocket_api/unicorn_binance_websocket_api_socket.py", line 114, in start_socket
received_stream_data = self.unicorn_fy.binance_com_websocket(received_stream_data_json)
File "/home/lordserenity/.local/lib/python3.8/site-packages/unicorn_fy/unicorn_fy.py", line 85, in binance_com_websocket
return UnicornFy.binance_websocket(stream_data_json, exchange="binance.com", show_deprecated_warning=False)
File "/home/lordserenity/.local/lib/python3.8/site-packages/unicorn_fy/unicorn_fy.py", line 255, in binance_websocket
if stream_data['data']['e'] == 'aggTrade':
KeyError: 'data'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
@@ -154,7 +154,7 @@ def __init__(self, | |||
enable_stream_signal_buffer=False): | |||
threading.Thread.__init__(self) | |||
self.name = "unicorn-binance-websocket-api" | |||
self.version = "1.28.0.dev" | |||
self.version = "1.28.1.dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*.dev is the development stage. Only when we create a new package we update this and remove the "dev". You dont need to care about this! Its done during the build of the package!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you undo the version changes? Then I would merge this.
Any news? |
Please do some conversation with me! I dont want to merge a PR if I have to fix something afterwards. So please remove the changes in unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py or I will close this. Thanks and best regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
PR Details
Description
Bug fix for:
unicorn_binance_websocket_api/unicorn_binance_websocket_api_manager.py", line 1300, in create_websocket_uri
elif "!" in market:
UnboundLocalError: local variable 'market' referenced before assignment
added default empty values for market & channel
Related Issue
Motivation and Context
How Has This Been Tested
Types of changes
Checklist
CONTRIBUTING
document.