-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
EofStream and websocket.receive_* functions #6800
Copy link
Copy link
Closed
Labels
HacktoberfestWe think it's good for https://hacktoberfest.digitalocean.com/We think it's good for https://hacktoberfest.digitalocean.com/buggood first issueGood for newcomersGood for newcomers
Description
aiohttp 3.8.1
await websocket.receive_json() Will die with TypeError on WSMsgType.CLOSED.
#2784 is fixed, yes:
async def __anext__(self) -> WSMessage:
msg = await self.receive()
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED):
raise StopAsyncIteration
return msgYes, bug is fixed in iterator but NOT fixed for websocket.receive_* functions, like receive_json()
I would raise RuntimeError or so if corresponding message "type" (like bytes, str, or json) can not be received.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
HacktoberfestWe think it's good for https://hacktoberfest.digitalocean.com/We think it's good for https://hacktoberfest.digitalocean.com/buggood first issueGood for newcomersGood for newcomers