Open
Description
Description
When a disconnection happens, a libjuju fails to raise a websocket connection closed failure.
Line emanating failure:
python-libjuju/juju/model/__init__.py
Line 1172 in 1907f7a
This seems linked to this commit of websockets:
python-websockets/websockets@5638611
https://github.com/python-websockets/websockets/blob/5638611169aa763ec84cdc8d2a967b0533401129/src/websockets/exceptions.py#L100
It introduced an assert that always fails in how python libjuju instantiates the exception.
Urgency
Blocker for our release
Python-libjuju version
3.6.1.0
Juju version
3.6.1
Reproduce / Test
This is a coding failure, just need to instantiate (not raise) the exception, and the assertion will fail:
python3
>>> import websockets
>>> websockets.ConnectionClosed(1006, "no reason")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gboutry/Documents/canonical/projects/python-libjuju/.venv/lib/python3.12/site-packages/websockets/exceptions.py", line 96, in __init__
assert (self.rcvd_then_sent is None) == (self.rcvd is None or self.sent is None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Activity