python-engineio 4.13.2__tar.gz → 4.13.4__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.
- {python_engineio-4.13.2/src/python_engineio.egg-info → python_engineio-4.13.4}/PKG-INFO +1 -1
- {python_engineio-4.13.2 → python_engineio-4.13.4}/pyproject.toml +1 -1
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_client.py +2 -2
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/_websocket_wsgi.py +2 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/client.py +16 -4
- {python_engineio-4.13.2 → python_engineio-4.13.4/src/python_engineio.egg-info}/PKG-INFO +1 -1
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_socket.py +2 -2
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_socket.py +5 -2
- {python_engineio-4.13.2 → python_engineio-4.13.4}/LICENSE +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/MANIFEST.in +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/README.md +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/docs/_static/README.md +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/setup.cfg +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/__init__.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/__init__.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/aiohttp.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/asgi.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/eventlet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/gevent.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/gevent_uwsgi.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/sanic.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/threading.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/tornado.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_server.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_socket.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/base_client.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/base_server.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/base_socket.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/exceptions.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/json.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/middleware.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/payload.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/server.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/socket.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/static_files.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/SOURCES.txt +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/dependency_links.txt +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/not-zip-safe +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/requires.txt +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/top_level.txt +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/__init__.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/index.html +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_aiohttp.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_asgi.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_client.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_sanic.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_server.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/async/test_tornado.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/__init__.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/index.html +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_client.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_middleware.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_payload.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/common/test_server.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/README.md +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/binary_b64_packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/binary_packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/json_packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/payload.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/run.sh +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/server_receive.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tests/performance/text_packet.py +0 -0
- {python_engineio-4.13.2 → python_engineio-4.13.4}/tox.ini +0 -0
|
@@ -571,7 +571,7 @@ class AsyncClient(base_client.BaseClient):
|
|
|
571
571
|
|
|
572
572
|
async def _read_loop_websocket(self):
|
|
573
573
|
"""Read packets from the Engine.IO WebSocket connection."""
|
|
574
|
-
while self.state == 'connected':
|
|
574
|
+
while self.state == 'connected' and self.write_loop_task:
|
|
575
575
|
p = None
|
|
576
576
|
try:
|
|
577
577
|
p = await asyncio.wait_for(
|
|
@@ -672,7 +672,6 @@ class AsyncClient(base_client.BaseClient):
|
|
|
672
672
|
if r.status < 200 or r.status >= 300:
|
|
673
673
|
self.logger.warning('Unexpected status code %s in server '
|
|
674
674
|
'response, aborting', r.status)
|
|
675
|
-
self.write_loop_task = None
|
|
676
675
|
break
|
|
677
676
|
else:
|
|
678
677
|
# websocket
|
|
@@ -690,3 +689,4 @@ class AsyncClient(base_client.BaseClient):
|
|
|
690
689
|
'aborting')
|
|
691
690
|
break
|
|
692
691
|
self.logger.info('Exiting write loop task')
|
|
692
|
+
self.write_loop_task = None
|
|
@@ -508,7 +508,13 @@ class Client(base_client.BaseClient):
|
|
|
508
508
|
|
|
509
509
|
if self.write_loop_task: # pragma: no branch
|
|
510
510
|
self.logger.info('Waiting for write loop task to end')
|
|
511
|
-
|
|
511
|
+
try:
|
|
512
|
+
# the write loop task cleans its own task when it ends, so we
|
|
513
|
+
# avoid a race condition when using threads with a try/catch
|
|
514
|
+
self.write_loop_task.join()
|
|
515
|
+
except AttributeError: # pragma: no cover
|
|
516
|
+
if self.write_loop_task is not None:
|
|
517
|
+
raise # for any erros not related to task == None we raise
|
|
512
518
|
if self.state == 'connected':
|
|
513
519
|
self._trigger_event('disconnect', self.reason.TRANSPORT_ERROR,
|
|
514
520
|
run_async=False)
|
|
@@ -521,7 +527,7 @@ class Client(base_client.BaseClient):
|
|
|
521
527
|
|
|
522
528
|
def _read_loop_websocket(self):
|
|
523
529
|
"""Read packets from the Engine.IO WebSocket connection."""
|
|
524
|
-
while self.state == 'connected':
|
|
530
|
+
while self.state == 'connected' and self.write_loop_task:
|
|
525
531
|
p = None
|
|
526
532
|
try:
|
|
527
533
|
p = self.ws.recv()
|
|
@@ -559,7 +565,13 @@ class Client(base_client.BaseClient):
|
|
|
559
565
|
|
|
560
566
|
if self.write_loop_task: # pragma: no branch
|
|
561
567
|
self.logger.info('Waiting for write loop task to end')
|
|
562
|
-
|
|
568
|
+
try:
|
|
569
|
+
# the write loop task cleans its own task when it ends, so we
|
|
570
|
+
# avoid a race condition when using threads with a try/catch
|
|
571
|
+
self.write_loop_task.join()
|
|
572
|
+
except AttributeError: # pragma: no cover
|
|
573
|
+
if self.write_loop_task is not None:
|
|
574
|
+
raise # for any erros not related to task == None we raise
|
|
563
575
|
if self.state == 'connected':
|
|
564
576
|
self._trigger_event('disconnect', self.reason.TRANSPORT_ERROR,
|
|
565
577
|
run_async=False)
|
|
@@ -616,7 +628,6 @@ class Client(base_client.BaseClient):
|
|
|
616
628
|
if r.status_code < 200 or r.status_code >= 300:
|
|
617
629
|
self.logger.warning('Unexpected status code %s in server '
|
|
618
630
|
'response, aborting', r.status_code)
|
|
619
|
-
self.write_loop_task = None
|
|
620
631
|
break
|
|
621
632
|
else:
|
|
622
633
|
# websocket
|
|
@@ -634,3 +645,4 @@ class Client(base_client.BaseClient):
|
|
|
634
645
|
'WebSocket connection was closed, aborting')
|
|
635
646
|
break
|
|
636
647
|
self.logger.info('Exiting write loop task')
|
|
648
|
+
self.write_loop_task = None
|
|
@@ -105,13 +105,13 @@ class TestSocket:
|
|
|
105
105
|
|
|
106
106
|
async def test_schedule_ping_twice(self):
|
|
107
107
|
mock_server = self._get_mock_server()
|
|
108
|
-
mock_server.ping_interval = 0.
|
|
108
|
+
mock_server.ping_interval = 0.1
|
|
109
109
|
s = async_socket.AsyncSocket(mock_server, 'sid')
|
|
110
110
|
s.send = mock.AsyncMock()
|
|
111
111
|
|
|
112
112
|
async def schedule_ping_and_sleep():
|
|
113
113
|
s.schedule_ping()
|
|
114
|
-
await asyncio.sleep(0.
|
|
114
|
+
await asyncio.sleep(0.2)
|
|
115
115
|
|
|
116
116
|
s.schedule_ping()
|
|
117
117
|
assert s.last_ping is None
|
|
@@ -101,7 +101,10 @@ class TestSocket:
|
|
|
101
101
|
s = socket.Socket(mock_server, 'sid')
|
|
102
102
|
s.send = mock.MagicMock()
|
|
103
103
|
s.schedule_ping()
|
|
104
|
-
|
|
104
|
+
for _ in range(10):
|
|
105
|
+
time.sleep(0.05)
|
|
106
|
+
if s.last_ping is not None:
|
|
107
|
+
break
|
|
105
108
|
assert s.last_ping is not None
|
|
106
109
|
assert s.send.call_args_list[0][0][0].encode() == '2'
|
|
107
110
|
|
|
@@ -114,7 +117,7 @@ class TestSocket:
|
|
|
114
117
|
assert s.last_ping is None
|
|
115
118
|
time.sleep(0.01)
|
|
116
119
|
s.schedule_ping()
|
|
117
|
-
time.sleep(0.
|
|
120
|
+
time.sleep(0.2)
|
|
118
121
|
assert s.last_ping is not None
|
|
119
122
|
assert s.send.call_count == 1
|
|
120
123
|
|
|
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
|
{python_engineio-4.13.2 → python_engineio-4.13.4}/src/engineio/async_drivers/gevent_uwsgi.py
RENAMED
|
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
|
{python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_engineio-4.13.2 → python_engineio-4.13.4}/src/python_engineio.egg-info/top_level.txt
RENAMED
|
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
|