Commit 637a77f
committed
fix: send str using send_bytes in websocket for starlette server
.send_text called .send_bytes
Bug introduced in #400, released since v1.25.0
This showed up when deploying in Modal with the error:
```
Traceback (most recent call last):
File "/pkg/modal/_runtime/container_io_manager.py", line 764, in handle_input_exception
yield
File "/pkg/modal/_container_entrypoint.py", line 210, in run_input_async
await generator_output_task # Wait to finish sending generator outputs.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pkg/synchronicity/async_wrap.py", line 29, in wrapper
return await user_wrapper(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pkg/synchronicity/async_wrap.py", line 29, in wrapper
return await user_wrapper(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pkg/synchronicity/async_wrap.py", line 32, in wrapper
raise uc_exc.exc
File "/pkg/modal/_runtime/container_io_manager.py", line 549, in generator_output_task
messages_bytes = [serialize_data_format(message, data_format)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pkg/modal/_serialization.py", line 346, in serialize_data_format
return _serialize_asgi(obj).SerializeToString(deterministic=True)
^^^^^^^^^^^^^^^^^^^^
File "/pkg/modal/_serialization.py", line 217, in _serialize_asgi
websocket_send=api_pb2.Asgi.WebsocketSend(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected bytes, str found
```1 parent e625b0a commit 637a77f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
0 commit comments