Skip to content

AttributeError: module 'ssl' has no attribute 'wrap_socket' #475

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
bugnano opened this issue Dec 26, 2023 · 5 comments
Open

AttributeError: module 'ssl' has no attribute 'wrap_socket' #475

bugnano opened this issue Dec 26, 2023 · 5 comments

Comments

@bugnano
Copy link

bugnano commented Dec 26, 2023

Describe the bug
I'm running Fedora 39 with Python 3.12.1
When trying to run gdbgui, everything crashes with the error: AttributeError: module 'ssl' has no attribute 'wrap_socket'

From what I've seen, it's an incompatible change brought by Python 3.12 (see eventlet/eventlet#795 for example).

To Reproduce
Try to run gdbgui

Expected behavior
It works

Screenshots

Traceback (most recent call last):
  File "/home/fri/.local/bin/gdbgui", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/fri/.local/lib/python3.12/site-packages/gdbgui/cli.py", line 249, in main
    run_server(
  File "/home/fri/.local/lib/python3.12/site-packages/gdbgui/server/server.py", line 68, in run_server
    socketio.init_app(app)
  File "/home/fri/.local/lib/python3.12/site-packages/flask_socketio/__init__.py", line 243, in init_app
    self.server = socketio.Server(**self.server_options)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fri/.local/lib/python3.12/site-packages/socketio/base_server.py", line 31, in __init__
    self.eio = self._engineio_server_class()(**engineio_options)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fri/.local/lib/python3.12/site-packages/engineio/base_server.py", line 70, in __init__
    self._async = importlib.import_module(
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/home/fri/.local/lib/python3.12/site-packages/engineio/async_drivers/eventlet.py", line 3, in <module>
    from eventlet.green.threading import Event
  File "/home/fri/.local/lib/python3.12/site-packages/eventlet/__init__.py", line 17, in <module>
    from eventlet import convenience
  File "/home/fri/.local/lib/python3.12/site-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/home/fri/.local/lib/python3.12/site-packages/eventlet/green/socket.py", line 21, in <module>
    from eventlet.support import greendns
  File "/home/fri/.local/lib/python3.12/site-packages/eventlet/support/greendns.py", line 45, in <module>
    from eventlet.green import ssl
  File "/home/fri/.local/lib/python3.12/site-packages/eventlet/green/ssl.py", line 25, in <module>
    _original_wrap_socket = __ssl.wrap_socket
                            ^^^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

Please complete the following information:

  • OS: Fedora 39
  • gdbgui version (gdbgui -v): 0.15.2.0
  • gdb version (gdb -v): 14.1-1.fc39
  • browser [e.g. chrome, safari]: Firefox
  • python packages (pip freeze):

Additional context
Add any other context about the problem here.

@Iuliean
Copy link

Iuliean commented Jan 3, 2024

Same here also on Fedora 39 same versions of gdbgui and gdb as OP

benjamindoron added a commit to benjamindoron/gdbgui that referenced this issue Feb 12, 2024
Update eventlet requirement for Python 3.12 support. Take this
opportunity to update all dependencies, nox tests still pass.

This fixes issue cs01#475.

Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
@MedAouadhi
Copy link

same here on mac os 14.4

@TomSaw
Copy link

TomSaw commented Jun 19, 2024

same on Fedora 40

@sergeyu
Copy link

sergeyu commented Aug 15, 2024

some on Linux Mint 22 Wilma

@scirelli
Copy link

scirelli commented Feb 5, 2025

I found something related here

The module-level ssl.wrap_socket() was marked as deprecated in Python 3.7 and fully removed in Python 3.12. Programs should create a SSLContext using ssl.create_default_context() and use the context instance's .wrap_socket() method.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants