Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial Code Bug #34

Closed
Waidhoferj opened this issue Sep 6, 2022 · 1 comment · Fixed by #35
Closed

Tutorial Code Bug #34

Waidhoferj opened this issue Sep 6, 2022 · 1 comment · Fixed by #35

Comments

@Waidhoferj
Copy link

Copying and running the code from the README yields the following error:

connection handler failed
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 945, in transfer_data
    message = await self.read_message()
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1015, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1090, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 1145, in read_frame
    frame = await Frame.read(
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/framing.py", line 70, in read
    data = await reader(2)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/asyncio/streams.py", line 721, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/server.py", line 232, in handler
    await self.ws_handler(self)
  File "/Users/johnwaidhofer/Desktop/Projects/ypy-websocket/ypy_websocket/websocket_server.py", line 105, in serve
    async for message in websocket:
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 482, in __aiter__
    yield await self.recv()
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 553, in recv
    await self.ensure_open()
  File "/opt/homebrew/Caskroom/miniforge/base/envs/ypy/lib/python3.8/site-packages/websockets/legacy/protocol.py", line 921, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: no close frame received or sent

System Info

  • OS: MacOS Monterey 12.5.1
  • Python version: 3.8.12
  • Architecture: ARM
@davidbrochart
Copy link
Collaborator

Thanks @Waidhoferj for opening an issue.
This should be fixed in #35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants