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

module 'websockets.exceptions' has no attribute 'ConnectionClosedError' #10

Closed
ampledata opened this issue May 24, 2021 · 1 comment
Closed

Comments

@ampledata
Copy link
Collaborator

Task completed: <Task finished coro=<Worker.run() done, defined at /usr/lib/python3/dist-packages/pytak/classes.py:55> exception=ConnectionResetError(104, 'Connection reset by peer')>
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<Worker.run() done, defined at /usr/lib/python3/dist-packages/pytak/classes.py:55> exception=ConnectionResetError(104, 'Connection reset by peer')>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pytak/classes.py", line 65, in run
    await self.handle_event(event)
  File "/usr/lib/python3/dist-packages/pytak/classes.py", line 100, in handle_event
    await self.writer.drain()
  File "/usr/lib/python3.7/asyncio/streams.py", line 339, in drain
    raise exc
  File "/usr/lib/python3.7/asyncio/selector_events.py", line 801, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer
ERROR:asyncio:unhandled exception during asyncio.run() shutdown
task: <Task finished coro=<StratuxWorker.run() done, defined at /usr/lib/python3/dist-packages/stratuxcot/classes.py:98> exception=AttributeError("module 'websockets.exceptions' has no attribute 'ConnectionClosedError'")>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/stratuxcot/classes.py", line 125, in run
    async for message in websocket:
  File "/usr/lib/python3/dist-packages/websockets/py36/protocol.py", line 15, in __aiter__
    yield await self.recv()
  File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 419, in recv
    return_when=asyncio.FIRST_COMPLETED,
  File "/usr/lib/python3.7/asyncio/tasks.py", line 363, in wait
    return await _wait(fs, timeout, return_when, loop)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 456, in _wait
    await waiter
concurrent.futures._base.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/stratuxcot/classes.py", line 130, in run
    except websockets.exceptions.ConnectionClosedError:
AttributeError: module 'websockets.exceptions' has no attribute 'ConnectionClosedError'
@ampledata
Copy link
Collaborator Author

System has a very old version of python3-websockets:
python3-websockets 7.0-1

ConnectionClosedError wasn't introduced until websockets 8:
https://github.com/aaugustin/websockets/blob/8446d7e02fb1fa3585d93a66d30811cc6bffbf8c/docs/project/changelog.rst#80

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

No branches or pull requests

1 participant