containers.execute() fails on Python3.12+
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| python-ws4py (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bug Description
When trying to execute a command on a container with pylxd (on Ubuntu 24.04.1 / Python 3.12.3), the following exception is raised:
```
Traceback (most recent call last):
File "/home/
instance.
File "/usr/lib/
stdin.connect()
File "/usr/lib/
self.sock = ssl.wrap_
AttributeError: module 'ssl' has no attribute 'wrap_socket'
```
To reproduce:
1) snap install lxd
2) lxd init --auto
3) lxc config set core.https_address :8443
4) apt install python3-pylxd
5) Run below script
```
#!/usr/bin/env python3
import pylxd
import subprocess
subprocess.
lxd_token = subprocess.run("lxc config trust add --name test -q", capture_
# setup container
subprocess.run("lxc launch images:alpine/3.20 testc", shell=True)
client = pylxd.Client(
client.
instance = client.
instance.
```
The issue is with the `python3-ws4py` dependency calling `ssl.wrap_
- https:/
- https:/
OS: Ubuntu 24.04.1
Python: 3.12.3
python3-pylxd: 2.2.10-3
python3-ws4py: 0.5.1+dfsg1-2
Thanks,
Miha
| description: | updated |
| summary: |
- containers.exeute() fails on Python3.12+ + containers.execute() fails on Python3.12+ |

@Miha, thanks for the simple reproducer steps, that's really useful. I moved the bug to ws4py as pyLXD itself is just a consumer of this lib.