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.
- {binance_sdk-2.2.0/binance_sdk.egg-info → binance_sdk-2.2.2}/PKG-INFO +1 -1
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/__init__.py +1 -1
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/orderbook.py +10 -2
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/user_processor.py +11 -1
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/stream.py +5 -2
- {binance_sdk-2.2.0 → binance_sdk-2.2.2/binance_sdk.egg-info}/PKG-INFO +1 -1
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/LICENSE +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/README.md +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/rest.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/apis/wapi.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/client/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/client/base.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/constants.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/exceptions.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/sequenced_list.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/types.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/common/utils.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/base.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/handlers.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/orderbook_handler.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/handlers/user_handlers.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/base.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/processors/processors.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/__init__.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/handler_context.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance/subscribe/manager.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/SOURCES.txt +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/dependency_links.txt +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/requires.txt +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/binance_sdk.egg-info/top_level.txt +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/docs/README.md +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/pyproject.toml +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/setup.cfg +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_client_base.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_exception_handler.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_exceptions.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_handlers.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_main.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_order_book.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_private.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_processors.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_rest_api.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_sequenced_list.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_stream.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_stream_retry.py +0 -0
- {binance_sdk-2.2.0 → binance_sdk-2.2.2}/test/test_subscribe.py +0 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|