module 'ssl' has no attribute 'wrap_socket'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-connector-python (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
python-pyvmomi (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
pyVmomi is not working with python 3.12 that ships with 24.04.
There is a commit in the official GIT repo to fix this. https:/
Here is an example of the errors you get when using it:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: module 'ssl' has no attribute 'wrap_socket'
fatal: [svnipap-0009 -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
File \"/root/
_ansiballz_
File \"/root/
invoke_
File \"/root/
runpy.
File \"<frozen runpy>\", line 226, in run_module
File \"<frozen runpy>\", line 98, in _run_module_code
File \"<frozen runpy>\", line 88, in _run_code
File \"/tmp/
File \"/tmp/
File \"/usr/
from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
File \"/usr/
from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \\
File \"/usr/
_SocketWrapper = ssl.wrap_socket
AttributeError: module 'ssl' has no attribute 'wrap_socket'
", "module_stdout": "", "msg": "MODULE FAILURE
See stdout/stderr for the exact error", "rc": 1}
Steps to reproduce:
# python3 -c 'from pyVim import connect'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
File "/usr/lib/
from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \
File "/usr/lib/
_SocketWrapper = ssl.wrap_socket
AttributeError: module 'ssl' has no attribute 'wrap_socket'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/
return apport_
File "/usr/lib/
report[
FileNotFoundError: [Errno 2] No such file or directory: '/etc/ansible/
Original exception was:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
from pyVmomi import vim, vmodl, SoapStubAdapter, SessionOrientedStub
File "/usr/lib/
from pyVmomi.SoapAdapter import SoapStubAdapter, StubAdapterBase, SoapCmdStubAdapter, \
File "/usr/lib/
_SocketWrapper = ssl.wrap_socket
AttributeError: module 'ssl' has no attribute 'wrap_socket'
The issue also affects the package python3- mysql.connector :
File "/usr/lib/ python3/ dist-packages/ mysql/connector /__init_ _.py", line 173, in connect (*args, **kwargs)
^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^ python3/ dist-packages/ mysql/connector /connection. py", line 102, in __init__ connect( **kwargs) python3/ dist-packages/ mysql/connector /abstracts. py", line 735, in connect _open_connectio n() python3/ dist-packages/ mysql/connector /connection. py", line 250, in _open_connection _do_auth( self._user, self._password, python3/ dist-packages/ mysql/connector /connection. py", line 155, in _do_auth _socket. switch_ to_ssl( ssl_options. get('ca' ), python3/ dist-packages/ mysql/connector /network. py", line 427, in switch_to_ssl
^^^^^ ^^^^^^^ ^^^
return MySQLConnection
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
self.sock = ssl.wrap_socket(
AttributeError: module 'ssl' has no attribute 'wrap_socket'