Closed jolaf closed 1 month ago
The following code:
from ws4py.client.threadedclient import WebSocketClient WebSocketClient('wss://google.com').connect()
produces the following output:
$ python test.py Traceback (most recent call last): File "test.py", line 3, in <module> WebSocketClient('wss://google.com').connect() File "/home/jolaf/.local/lib/python3.12/site-packages/ws4py/client/__init__.py", line 214, in connect self.sock = ssl.wrap_socket(self.sock, **self.ssl_options) ^^^^^^^^^^^^^^^ AttributeError: module 'ssl' has no attribute 'wrap_socket'
because ssl.wrap_socket() was removed in Python 3.12.
ssl.wrap_socket()
$ python3 --version Python 3.12.3 $ lsb_release -d No LSB modules are available. Description: Ubuntu 24.04 LTS
does this patch help? https://github.com/Lawouach/WebSocket-for-Python/pull/283
does this patch help? #283
Yes.
Closing as fixed by #283.
The following code:
produces the following output:
because
ssl.wrap_socket()
was removed in Python 3.12.