python-engineio 4.13.2__tar.gz → 4.13.3__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 (65) hide show
  1. {python_engineio-4.13.2/src/python_engineio.egg-info → python_engineio-4.13.3}/PKG-INFO +1 -1
  2. {python_engineio-4.13.2 → python_engineio-4.13.3}/pyproject.toml +1 -1
  3. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_client.py +2 -2
  4. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/client.py +2 -2
  5. {python_engineio-4.13.2 → python_engineio-4.13.3/src/python_engineio.egg-info}/PKG-INFO +1 -1
  6. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_socket.py +2 -2
  7. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_socket.py +5 -2
  8. {python_engineio-4.13.2 → python_engineio-4.13.3}/LICENSE +0 -0
  9. {python_engineio-4.13.2 → python_engineio-4.13.3}/MANIFEST.in +0 -0
  10. {python_engineio-4.13.2 → python_engineio-4.13.3}/README.md +0 -0
  11. {python_engineio-4.13.2 → python_engineio-4.13.3}/docs/_static/README.md +0 -0
  12. {python_engineio-4.13.2 → python_engineio-4.13.3}/setup.cfg +0 -0
  13. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/__init__.py +0 -0
  14. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/__init__.py +0 -0
  15. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/_websocket_wsgi.py +0 -0
  16. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/aiohttp.py +0 -0
  17. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/asgi.py +0 -0
  18. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/eventlet.py +0 -0
  19. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/gevent.py +0 -0
  20. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/gevent_uwsgi.py +0 -0
  21. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/sanic.py +0 -0
  22. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/threading.py +0 -0
  23. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_drivers/tornado.py +0 -0
  24. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_server.py +0 -0
  25. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/async_socket.py +0 -0
  26. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/base_client.py +0 -0
  27. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/base_server.py +0 -0
  28. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/base_socket.py +0 -0
  29. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/exceptions.py +0 -0
  30. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/json.py +0 -0
  31. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/middleware.py +0 -0
  32. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/packet.py +0 -0
  33. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/payload.py +0 -0
  34. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/server.py +0 -0
  35. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/socket.py +0 -0
  36. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/engineio/static_files.py +0 -0
  37. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/python_engineio.egg-info/SOURCES.txt +0 -0
  38. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/python_engineio.egg-info/dependency_links.txt +0 -0
  39. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/python_engineio.egg-info/not-zip-safe +0 -0
  40. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/python_engineio.egg-info/requires.txt +0 -0
  41. {python_engineio-4.13.2 → python_engineio-4.13.3}/src/python_engineio.egg-info/top_level.txt +0 -0
  42. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/__init__.py +0 -0
  43. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/index.html +0 -0
  44. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_aiohttp.py +0 -0
  45. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_asgi.py +0 -0
  46. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_client.py +0 -0
  47. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_sanic.py +0 -0
  48. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_server.py +0 -0
  49. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/async/test_tornado.py +0 -0
  50. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/__init__.py +0 -0
  51. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/index.html +0 -0
  52. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_client.py +0 -0
  53. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_middleware.py +0 -0
  54. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_packet.py +0 -0
  55. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_payload.py +0 -0
  56. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/common/test_server.py +0 -0
  57. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/README.md +0 -0
  58. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/binary_b64_packet.py +0 -0
  59. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/binary_packet.py +0 -0
  60. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/json_packet.py +0 -0
  61. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/payload.py +0 -0
  62. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/run.sh +0 -0
  63. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/server_receive.py +0 -0
  64. {python_engineio-4.13.2 → python_engineio-4.13.3}/tests/performance/text_packet.py +0 -0
  65. {python_engineio-4.13.2 → python_engineio-4.13.3}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-engineio
3
- Version: 4.13.2
3
+ Version: 4.13.3
4
4
  Summary: Engine.IO server and client for Python
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-engineio"
3
- version = "4.13.2"
3
+ version = "4.13.3"
4
4
  license = {text = "MIT"}
5
5
  authors = [{name = "Miguel Grinberg", email = "miguel.grinberg@gmail.com"}]
6
6
  description = "Engine.IO server and client for Python"
@@ -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
@@ -521,7 +521,7 @@ class Client(base_client.BaseClient):
521
521
 
522
522
  def _read_loop_websocket(self):
523
523
  """Read packets from the Engine.IO WebSocket connection."""
524
- while self.state == 'connected':
524
+ while self.state == 'connected' and self.write_loop_task:
525
525
  p = None
526
526
  try:
527
527
  p = self.ws.recv()
@@ -616,7 +616,6 @@ class Client(base_client.BaseClient):
616
616
  if r.status_code < 200 or r.status_code >= 300:
617
617
  self.logger.warning('Unexpected status code %s in server '
618
618
  'response, aborting', r.status_code)
619
- self.write_loop_task = None
620
619
  break
621
620
  else:
622
621
  # websocket
@@ -634,3 +633,4 @@ class Client(base_client.BaseClient):
634
633
  'WebSocket connection was closed, aborting')
635
634
  break
636
635
  self.logger.info('Exiting write loop task')
636
+ self.write_loop_task = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-engineio
3
- Version: 4.13.2
3
+ Version: 4.13.3
4
4
  Summary: Engine.IO server and client for Python
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  License: MIT
@@ -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.01
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.05)
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
- time.sleep(0.05)
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.1)
120
+ time.sleep(0.2)
118
121
  assert s.last_ping is not None
119
122
  assert s.send.call_count == 1
120
123