python-engineio 4.8.1__tar.gz → 4.8.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 (75) hide show
  1. {python-engineio-4.8.1/src/python_engineio.egg-info → python-engineio-4.8.2}/PKG-INFO +1 -1
  2. {python-engineio-4.8.1 → python-engineio-4.8.2}/pyproject.toml +1 -1
  3. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_client.py +13 -2
  4. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_server.py +14 -2
  5. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/client.py +4 -1
  6. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/server.py +5 -2
  7. {python-engineio-4.8.1 → python-engineio-4.8.2/src/python_engineio.egg-info}/PKG-INFO +1 -1
  8. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_client.py +2 -2
  9. {python-engineio-4.8.1 → python-engineio-4.8.2}/LICENSE +0 -0
  10. {python-engineio-4.8.1 → python-engineio-4.8.2}/MANIFEST.in +0 -0
  11. {python-engineio-4.8.1 → python-engineio-4.8.2}/README.md +0 -0
  12. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/Makefile +0 -0
  13. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/_static/README.md +0 -0
  14. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/api.rst +0 -0
  15. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/client.rst +0 -0
  16. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/conf.py +0 -0
  17. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/index.rst +0 -0
  18. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/intro.rst +0 -0
  19. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/make.bat +0 -0
  20. {python-engineio-4.8.1 → python-engineio-4.8.2}/docs/server.rst +0 -0
  21. {python-engineio-4.8.1 → python-engineio-4.8.2}/setup.cfg +0 -0
  22. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/__init__.py +0 -0
  23. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/__init__.py +0 -0
  24. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/_websocket_wsgi.py +0 -0
  25. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/aiohttp.py +0 -0
  26. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/asgi.py +0 -0
  27. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/eventlet.py +0 -0
  28. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/gevent.py +0 -0
  29. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/gevent_uwsgi.py +0 -0
  30. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/sanic.py +0 -0
  31. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/threading.py +0 -0
  32. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_drivers/tornado.py +0 -0
  33. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/async_socket.py +0 -0
  34. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/base_client.py +0 -0
  35. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/base_server.py +0 -0
  36. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/base_socket.py +0 -0
  37. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/exceptions.py +0 -0
  38. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/json.py +0 -0
  39. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/middleware.py +0 -0
  40. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/packet.py +0 -0
  41. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/payload.py +0 -0
  42. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/socket.py +0 -0
  43. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/engineio/static_files.py +0 -0
  44. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/python_engineio.egg-info/SOURCES.txt +0 -0
  45. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/python_engineio.egg-info/dependency_links.txt +0 -0
  46. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/python_engineio.egg-info/not-zip-safe +0 -0
  47. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/python_engineio.egg-info/requires.txt +0 -0
  48. {python-engineio-4.8.1 → python-engineio-4.8.2}/src/python_engineio.egg-info/top_level.txt +0 -0
  49. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/__init__.py +0 -0
  50. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/__init__.py +0 -0
  51. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/index.html +0 -0
  52. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_aiohttp.py +0 -0
  53. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_asgi.py +0 -0
  54. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_client.py +0 -0
  55. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_sanic.py +0 -0
  56. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_server.py +0 -0
  57. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_socket.py +0 -0
  58. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/async/test_tornado.py +0 -0
  59. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/__init__.py +0 -0
  60. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/index.html +0 -0
  61. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_async_eventlet.py +0 -0
  62. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_middleware.py +0 -0
  63. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_packet.py +0 -0
  64. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_payload.py +0 -0
  65. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_server.py +0 -0
  66. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/common/test_socket.py +0 -0
  67. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/README.md +0 -0
  68. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/binary_b64_packet.py +0 -0
  69. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/binary_packet.py +0 -0
  70. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/json_packet.py +0 -0
  71. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/payload.py +0 -0
  72. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/run.sh +0 -0
  73. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/server_receive.py +0 -0
  74. {python-engineio-4.8.1 → python-engineio-4.8.2}/tests/performance/text_packet.py +0 -0
  75. {python-engineio-4.8.1 → python-engineio-4.8.2}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-engineio
3
- Version: 4.8.1
3
+ Version: 4.8.2
4
4
  Summary: Engine.IO server and client for Python
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/miguelgrinberg/python-engineio
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-engineio"
3
- version = "4.8.1"
3
+ version = "4.8.2"
4
4
  authors = [{name = "Miguel Grinberg", email = "miguel.grinberg@gmail.com"}]
5
5
  description = "Engine.IO server and client for Python"
6
6
  classifiers = [
@@ -15,6 +15,11 @@ from . import payload
15
15
 
16
16
  async_signal_handler_set = False
17
17
 
18
+ # this set is used to keep references to background tasks to prevent them from
19
+ # being garbage collected mid-execution. Solution taken from
20
+ # https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task
21
+ task_reference_holder = set()
22
+
18
23
 
19
24
  def async_signal_handler():
20
25
  """SIGINT handler.
@@ -450,8 +455,11 @@ class AsyncClient(base_client.BaseClient):
450
455
  if event in self.handlers:
451
456
  if asyncio.iscoroutinefunction(self.handlers[event]) is True:
452
457
  if run_async:
453
- return self.start_background_task(self.handlers[event],
458
+ task = self.start_background_task(self.handlers[event],
454
459
  *args)
460
+ task_reference_holder.add(task)
461
+ task.add_done_callback(task_reference_holder.discard)
462
+ return task
455
463
  else:
456
464
  try:
457
465
  ret = await self.handlers[event](*args)
@@ -468,7 +476,10 @@ class AsyncClient(base_client.BaseClient):
468
476
  async def async_handler():
469
477
  return self.handlers[event](*args)
470
478
 
471
- return self.start_background_task(async_handler)
479
+ task = self.start_background_task(async_handler)
480
+ task_reference_holder.add(task)
481
+ task.add_done_callback(task_reference_holder.discard)
482
+ return task
472
483
  else:
473
484
  try:
474
485
  ret = self.handlers[event](*args)
@@ -6,6 +6,11 @@ from . import exceptions
6
6
  from . import packet
7
7
  from . import async_socket
8
8
 
9
+ # this set is used to keep references to background tasks to prevent them from
10
+ # being garbage collected mid-execution. Solution taken from
11
+ # https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task
12
+ task_reference_holder = set()
13
+
9
14
 
10
15
  class AsyncServer(base_server.BaseServer):
11
16
  """An Engine.IO server for asyncio.
@@ -30,8 +35,11 @@ class AsyncServer(base_server.BaseServer):
30
35
  :param ping_timeout: The time in seconds that the client waits for the
31
36
  server to respond before disconnecting. The default
32
37
  is 20 seconds.
33
- :param max_http_buffer_size: The maximum size of a message. The default
34
- is 1,000,000 bytes.
38
+ :param max_http_buffer_size: The maximum size that is accepted for incoming
39
+ messages. The default is 1,000,000 bytes. In
40
+ spite of its name, the value set in this
41
+ argument is enforced for HTTP long-polling and
42
+ WebSocket connections.
35
43
  :param allow_upgrades: Whether to allow transport upgrades or not.
36
44
  :param http_compression: Whether to compress packages when using the
37
45
  polling transport.
@@ -484,6 +492,8 @@ class AsyncServer(base_server.BaseServer):
484
492
 
485
493
  if run_async:
486
494
  ret = self.start_background_task(run_async_handler)
495
+ task_reference_holder.add(ret)
496
+ ret.add_done_callback(task_reference_holder.discard)
487
497
  else:
488
498
  ret = await run_async_handler()
489
499
  else:
@@ -499,6 +509,8 @@ class AsyncServer(base_server.BaseServer):
499
509
 
500
510
  if run_async:
501
511
  ret = self.start_background_task(run_sync_handler)
512
+ task_reference_holder.add(ret)
513
+ ret.add_done_callback(task_reference_holder.discard)
502
514
  else:
503
515
  ret = await run_sync_handler()
504
516
  return ret
@@ -309,7 +309,10 @@ class Client(base_client.BaseClient):
309
309
  self.ssl_verify = False
310
310
 
311
311
  if not self.ssl_verify:
312
- extra_options['sslopt'] = {"cert_reqs": ssl.CERT_NONE}
312
+ if 'sslopt' in extra_options:
313
+ extra_options['sslopt'].update({"cert_reqs": ssl.CERT_NONE})
314
+ else:
315
+ extra_options['sslopt'] = {"cert_reqs": ssl.CERT_NONE}
313
316
 
314
317
  # combine internally generated options with the ones supplied by the
315
318
  # caller. The caller's options take precedence.
@@ -31,8 +31,11 @@ class Server(base_server.BaseServer):
31
31
  :param ping_timeout: The time in seconds that the client waits for the
32
32
  server to respond before disconnecting. The default
33
33
  is 20 seconds.
34
- :param max_http_buffer_size: The maximum size of a message. The default
35
- is 1,000,000 bytes.
34
+ :param max_http_buffer_size: The maximum size that is accepted for incoming
35
+ messages. The default is 1,000,000 bytes. In
36
+ spite of its name, the value set in this
37
+ argument is enforced for HTTP long-polling and
38
+ WebSocket connections.
36
39
  :param allow_upgrades: Whether to allow transport upgrades or not. The
37
40
  default is ``True``.
38
41
  :param http_compression: Whether to compress packages when using the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-engineio
3
- Version: 4.8.1
3
+ Version: 4.8.2
4
4
  Summary: Engine.IO server and client for Python
5
5
  Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/miguelgrinberg/python-engineio
@@ -879,7 +879,7 @@ class TestClient(unittest.TestCase):
879
879
  http.auth = None
880
880
  http.proxies = None
881
881
  http.cert = 'foo.crt'
882
- c = client.Client(http_session=http)
882
+ c = client.Client(http_session=http, ssl_verify=False)
883
883
  c._read_loop_polling = mock.MagicMock()
884
884
  c._read_loop_websocket = mock.MagicMock()
885
885
  c._write_loop = mock.MagicMock()
@@ -889,7 +889,7 @@ class TestClient(unittest.TestCase):
889
889
 
890
890
  assert len(create_connection.call_args_list) == 1
891
891
  assert create_connection.call_args[1] == {
892
- 'sslopt': {'certfile': 'foo.crt'},
892
+ 'sslopt': {'cert_reqs': ssl.CERT_NONE, 'certfile': 'foo.crt'},
893
893
  'header': {},
894
894
  'cookie': '',
895
895
  'enable_multithread': True,
File without changes
File without changes