python-engineio 4.8.0__py3-none-any.whl → 4.8.1__py3-none-any.whl

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.
@@ -233,9 +233,14 @@ class WebSocket(object): # pragma: no cover
233
233
  self.asgi_send = environ['asgi.send']
234
234
  await self.asgi_send({'type': 'websocket.accept'})
235
235
  await self.handler(self)
236
+ return '' # send nothing as response
236
237
 
237
238
  async def close(self):
238
- pass
239
+ try:
240
+ await self.asgi_send({'type': 'websocket.close'})
241
+ except Exception:
242
+ # if the socket is already close we don't care
243
+ pass
239
244
 
240
245
  async def send(self, message):
241
246
  msg_bytes = None
@@ -61,6 +61,7 @@ class uWSGIWebSocket(object): # pragma: no cover
61
61
 
62
62
  self.app(self)
63
63
  uwsgi.disconnect()
64
+ return '' # send nothing as response
64
65
 
65
66
  def close(self):
66
67
  """Disconnects uWSGI from the client."""
@@ -114,6 +114,7 @@ class WebSocket(object): # pragma: no cover
114
114
  """
115
115
  def __init__(self, handler, server):
116
116
  self.handler = handler
117
+ self.server = server
117
118
  self._sock = None
118
119
 
119
120
  async def __call__(self, environ):
@@ -123,6 +124,7 @@ class WebSocket(object): # pragma: no cover
123
124
 
124
125
  self.environ = environ
125
126
  await self.handler(self)
127
+ return self.server._ok()
126
128
 
127
129
  async def close(self):
128
130
  await self._sock.close()
engineio/async_socket.py CHANGED
@@ -140,7 +140,7 @@ class AsyncSocket(base_socket.BaseSocket):
140
140
  return self.server._bad_request()
141
141
  ws = self.server._async['websocket'](
142
142
  self._websocket_handler, self.server)
143
- await ws(environ)
143
+ return await ws(environ)
144
144
 
145
145
  async def _websocket_handler(self, ws):
146
146
  """Engine.IO handler for websocket transport."""
engineio/server.py CHANGED
@@ -306,7 +306,7 @@ class Server(base_server.BaseServer):
306
306
  r = self._method_not_found()
307
307
 
308
308
  if not isinstance(r, dict):
309
- return r or []
309
+ return r
310
310
  if self.http_compression and \
311
311
  len(r['response']) >= self.compression_threshold:
312
312
  encodings = [e.split(';')[0].strip() for e in
engineio/socket.py CHANGED
@@ -143,8 +143,7 @@ class Socket(base_socket.BaseSocket):
143
143
  return self.server._bad_request()
144
144
  ws = self.server._async['websocket'](
145
145
  self._websocket_handler, self.server)
146
- ws(environ, start_response)
147
- return self.server._ok()
146
+ return ws(environ, start_response)
148
147
 
149
148
  def _websocket_handler(self, ws):
150
149
  """Engine.IO handler for websocket transport."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-engineio
3
- Version: 4.8.0
3
+ Version: 4.8.1
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
@@ -27,7 +27,7 @@ python-engineio
27
27
 
28
28
  [![Build status](https://github.com/miguelgrinberg/python-engineio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/python-engineio/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/python-engineio/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/python-engineio)
29
29
 
30
- Python implementation of the `Engine.IO`_ realtime client and server.
30
+ Python implementation of the `Engine.IO` realtime client and server.
31
31
 
32
32
  Sponsors
33
33
  --------
@@ -42,7 +42,7 @@ Many individual sponsors also support this project through small ongoing contrib
42
42
  Resources
43
43
  ---------
44
44
 
45
- - [Documentation](https://python-engineio.readthedocs.io/en/latest/)
45
+ - [Documentation](https://python-engineio.readthedocs.io/)
46
46
  - [PyPI](https://pypi.python.org/pypi/python-engineio)
47
47
  - [Change Log](https://github.com/miguelgrinberg/python-engineio/blob/main/CHANGES.md)
48
48
  - Questions? See the [questions](https://stackoverflow.com/questions/tagged/python-socketio) others have asked on Stack Overflow, or [ask](https://stackoverflow.com/questions/ask?tags=python+python-socketio) your own question.
@@ -1,7 +1,7 @@
1
1
  engineio/__init__.py,sha256=0R2PY1EXu3sicP7mkA0_QxEVGRlFlgvsxfhByqREE1A,481
2
2
  engineio/async_client.py,sha256=RgyPsoJCL68krJeAAZ512BFYXIttyQWzbJBKrXCasB0,27076
3
3
  engineio/async_server.py,sha256=k76ViVI0OhhtvcsxSN7Bu8fpHIYo2NFlI-pMozTUmBE,24329
4
- engineio/async_socket.py,sha256=hsTOmV6I4DULCLcRTu_K6LFoyLH4sp8xcyztSluTiWw,10298
4
+ engineio/async_socket.py,sha256=P8OZW1N5y7jr2hW1qLLK2y_Clt7aHdv2ucYW69mbU4Q,10305
5
5
  engineio/base_client.py,sha256=Q_w0Stvy89wPHwWk7411dRxpGjxNPypm4xy_4XMPZ9M,4872
6
6
  engineio/base_server.py,sha256=Em2RRpbohulKjmYTWHnf_lALKvTT_jHr442Rr2g_BEQ,14013
7
7
  engineio/base_socket.py,sha256=Bw6TWv1pnlXcDdqT59C5CyTaBi7l-_mkykIUuZLjz-g,400
@@ -11,21 +11,21 @@ engineio/json.py,sha256=SG5FTojqd1ix6u0dKXJsZVqqdYioZLO4S2GPL7BKl3U,405
11
11
  engineio/middleware.py,sha256=BF_qHAIZZnIbfiP256SD1CX3kzNWbSuto1cpih8oIFg,3766
12
12
  engineio/packet.py,sha256=ETMeLgdpZghXK9fth93IZO8pIft6Sg3d1QGpyTx4xBE,3189
13
13
  engineio/payload.py,sha256=2iLIFgIweTWkLok_UZ5zCgELmRSGyUUI5eeYcEerFSs,1547
14
- engineio/server.py,sha256=mb4fOZZwrcxQV1aPXD8Rtxj8MPrkSrj1P-1-I0O9wvo,21325
15
- engineio/socket.py,sha256=Qo0ZAt5lYr85Js_nv-d4luG4bPp8gt2LWsdnYjW2RT8,10022
14
+ engineio/server.py,sha256=2Ci3Q0wbEPXDcf-6awV6VSkDVeM5zdk63HtrVabEG1c,21319
15
+ engineio/socket.py,sha256=dasec3jXoV2eR1jmIrhEIfHzyUuuv8FwvxLB3DpyjeY,9996
16
16
  engineio/static_files.py,sha256=pwez9LQFaSQXMbtI0vLyD6UDiokQ4rNfmRYgVLKOthc,2064
17
17
  engineio/async_drivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  engineio/async_drivers/_websocket_wsgi.py,sha256=FGoRBGOUsEtlfklYNylR0o3oLOGmXIR8QzaCsGLgr3I,949
19
19
  engineio/async_drivers/aiohttp.py,sha256=zJdujjO6dSL_oKDDr4xfO4ID_Vd8faEp1AOIW4ogKME,3768
20
- engineio/async_drivers/asgi.py,sha256=VszVveQx7IWhg5niyCZCSspP61Q07dB24dsjK8AXZN8,10144
20
+ engineio/async_drivers/asgi.py,sha256=AVEXVP4KLu0etH2kTiuJgVTUkstdNHh0srQSxXx3sBM,10354
21
21
  engineio/async_drivers/eventlet.py,sha256=IG6oLaWH663dw5CEnO-SRz6IsJb6lO55kRCYTdmqZE0,1755
22
22
  engineio/async_drivers/gevent.py,sha256=hnJHeWdDQE2jfoLCP5DnwVPzsQlcTLJUMA5EVf1UL-k,2962
23
- engineio/async_drivers/gevent_uwsgi.py,sha256=pz02xUdrlu6gMaR71TEHQ4injzQvmQlyGSe--STsIj4,5916
24
- engineio/async_drivers/sanic.py,sha256=6X03Qo2cj8yV-nv1VdTpdTM2IhgEdRxUq6GI28-DT-M,4476
23
+ engineio/async_drivers/gevent_uwsgi.py,sha256=cnjCsnDHTa6rKgwDKD6rLvIw1Yun-g4c1QbujOC_bMY,5962
24
+ engineio/async_drivers/sanic.py,sha256=SY0HIp5DUHF7B55tJCBB_8qDjrRTD_FyNQ2cIwRIGR8,4538
25
25
  engineio/async_drivers/threading.py,sha256=ywmG59d4H6OHZjKarBN97-9BHEsRxFEz9YN-E9QAu_I,463
26
26
  engineio/async_drivers/tornado.py,sha256=9bB7FvY47Snx_h4rsNwRk5wIINf2ju7hXWTAqF3intA,5909
27
- python_engineio-4.8.0.dist-info/LICENSE,sha256=yel9Pbwfu82094CLKCzWRtuIev9PUxP-a76NTDFAWpw,1082
28
- python_engineio-4.8.0.dist-info/METADATA,sha256=KqgsKKYpSPaXsp7sV3abA-7vFPHFGsrbtyWbcBNPSWw,2255
29
- python_engineio-4.8.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
30
- python_engineio-4.8.0.dist-info/top_level.txt,sha256=u8PmNisCZLwRYcWrNLe9wutQ2tt4zNi8IH362c-HWuA,9
31
- python_engineio-4.8.0.dist-info/RECORD,,
27
+ python_engineio-4.8.1.dist-info/LICENSE,sha256=yel9Pbwfu82094CLKCzWRtuIev9PUxP-a76NTDFAWpw,1082
28
+ python_engineio-4.8.1.dist-info/METADATA,sha256=3xVrBLi6niAX6yxAiEW5ksFbBjeXs8pOrKYqGj35vM8,2244
29
+ python_engineio-4.8.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
30
+ python_engineio-4.8.1.dist-info/top_level.txt,sha256=u8PmNisCZLwRYcWrNLe9wutQ2tt4zNi8IH362c-HWuA,9
31
+ python_engineio-4.8.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5