binance-sdk 2.2.0__tar.gz → 2.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {binance_sdk-2.2.0/binance_sdk.egg-info → binance_sdk-2.2.2}/PKG-INFO +1 -1
  2. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/__init__.py +1 -1
  3. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/orderbook.py +10 -2
  4. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/user_processor.py +11 -1
  5. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/stream.py +5 -2
  6. {binance_sdk-2.2.0 → binance_sdk-2.2.2/binance_sdk.egg-info}/PKG-INFO +1 -1
  7. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/LICENSE +0 -0
  8. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/README.md +0 -0
  9. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/__init__.py +0 -0
  10. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/rest.py +0 -0
  11. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/wapi.py +0 -0
  12. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/client/__init__.py +0 -0
  13. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/client/base.py +0 -0
  14. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/__init__.py +0 -0
  15. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/constants.py +0 -0
  16. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/exceptions.py +0 -0
  17. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/sequenced_list.py +0 -0
  18. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/types.py +0 -0
  19. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/utils.py +0 -0
  20. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/__init__.py +0 -0
  21. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/base.py +0 -0
  22. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/handlers.py +0 -0
  23. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/orderbook_handler.py +0 -0
  24. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/user_handlers.py +0 -0
  25. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/__init__.py +0 -0
  26. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/base.py +0 -0
  27. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/processors.py +0 -0
  28. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/__init__.py +0 -0
  29. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/handler_context.py +0 -0
  30. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/manager.py +0 -0
  31. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/SOURCES.txt +0 -0
  32. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/dependency_links.txt +0 -0
  33. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/requires.txt +0 -0
  34. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/top_level.txt +0 -0
  35. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/docs/README.md +0 -0
  36. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/pyproject.toml +0 -0
  37. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/setup.cfg +0 -0
  38. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_client_base.py +0 -0
  39. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_exception_handler.py +0 -0
  40. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_exceptions.py +0 -0
  41. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_handlers.py +0 -0
  42. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_main.py +0 -0
  43. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_order_book.py +0 -0
  44. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_private.py +0 -0
  45. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_processors.py +0 -0
  46. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_rest_api.py +0 -0
  47. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_sequenced_list.py +0 -0
  48. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_stream.py +0 -0
  49. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_stream_retry.py +0 -0
  50. {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_subscribe.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binance-sdk
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Binance Python SDK
5
5
  Author-email: Master God <you-dont-know-who@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/mastergod/binance-sdk
@@ -1,4 +1,4 @@
1
- __version__ = '2.2.0'
1
+ __version__ = '2.2.2'
2
2
 
3
3
  from aioretry import (
4
4
  RetryPolicy,
@@ -22,7 +22,9 @@ from binance.common.constants import (
22
22
 
23
23
  from binance.common.utils import (
24
24
  normalize_symbol,
25
- create_future
25
+ create_future,
26
+ format_msg,
27
+ repr_exception
26
28
  )
27
29
  from binance.common.exceptions import OrderBookFetchAbandonedException
28
30
 
@@ -213,12 +215,18 @@ class OrderBook:
213
215
  def _handle_fetch_exception(self, task):
214
216
  """Handle exceptions from fetch task to prevent 'Future exception was never retrieved' warnings"""
215
217
 
218
+ if task.cancelled():
219
+ return
220
+
216
221
  # Retrieve the exception if the task failed
217
222
  exception = task.exception()
218
223
  if exception is not None and self._client is not None:
219
224
  # Log the error but don't re-raise as this is a background task
220
225
  self._client.logger.error(
221
- f'Fetch task failed with exception: {exception}'
226
+ format_msg(
227
+ 'Fetch task failed with exception: %s',
228
+ repr_exception(exception)
229
+ )
222
230
  )
223
231
 
224
232
  async def fetch(self) -> None:
@@ -10,6 +10,10 @@ from binance.common.constants import (
10
10
  )
11
11
 
12
12
  from binance.common.exceptions import UserStreamNotSubscribedException
13
+ from binance.common.utils import (
14
+ format_msg,
15
+ repr_exception
16
+ )
13
17
 
14
18
  from binance.handlers.user_handlers import (
15
19
  AccountInfoHandlerBase,
@@ -101,11 +105,17 @@ class UserProcessor(Processor):
101
105
  def _handle_keep_alive_exception(self, task):
102
106
  """Handle exceptions from keep-alive task to prevent 'Future exception was never retrieved' warnings"""
103
107
 
108
+ if task.cancelled():
109
+ return
110
+
104
111
  # Retrieve the exception if the task failed
105
112
  exception = task.exception()
106
113
  if exception is not None:
107
114
  self._client.logger.error(
108
- f'Keep-alive task failed with exception: {exception}'
115
+ format_msg(
116
+ 'Keep-alive task failed with exception: %s',
117
+ repr_exception(exception)
118
+ )
109
119
  )
110
120
 
111
121
  async def _close_stream(self) -> None:
@@ -301,12 +301,12 @@ class Stream:
301
301
  # The socket is closed by `await self.close()`
302
302
  return
303
303
 
304
- self._connection_error = True
305
-
306
304
  # Raise, so aioretry will reconnecting
307
305
  raise e
308
306
 
309
307
  async def _reconnect(self, info: RetryInfo) -> None:
308
+ self._connection_error = True
309
+
310
310
  self._logger.error(
311
311
  format_msg(
312
312
  'socket error %s, reconnecting %s...',
@@ -453,6 +453,9 @@ class Stream:
453
453
  def _handle_task_exception(self, task):
454
454
  """Handle exceptions from background tasks to prevent 'Future exception was never retrieved' warnings"""
455
455
 
456
+ if task.cancelled():
457
+ return
458
+
456
459
  # Retrieve the exception if the task failed
457
460
  exception = task.exception()
458
461
  if exception is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binance-sdk
3
- Version: 2.2.0
3
+ Version: 2.2.2
4
4
  Summary: Binance Python SDK
5
5
  Author-email: Master God <you-dont-know-who@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/mastergod/binance-sdk
File without changes
File without changes
File without changes
File without changes
File without changes