Bug 2215554 - ImportError: cannot import name 'match_hostname' from 'ssl' (/usr/lib64/python3.12/ssl.py)
Summary: ImportError: cannot import name 'match_hostname' from 'ssl' (/usr/lib64/pytho...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-gevent
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-16 13:57 UTC by Orion Poplawski
Modified: 2023-09-01 00:00 UTC (History)
3 users (show)

Fixed In Version: python-gevent-23.7.0-1.fc39
Clone Of:
Environment:
Last Closed: 2023-09-01 00:00:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2023-06-16 13:57:19 UTC
While building python-x2go with Python 3.12:

+ make -C docs SPHINXBUILD=/usr/bin/sphinx-build-3 html
make: Entering directory '/builddir/build/BUILD/python-x2go-0.6.1.3/docs'
/usr/bin/sphinx-build-3 -b html -d build/doctrees   source build/html
Running Sphinx v6.1.3
Configuration error:
There is a programmable error in your configuration file:
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/sphinx/config.py", line 351, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-x2go-0.6.1.3/docs/source/conf.py", line 22, in <module>
    import x2go
  File "/builddir/build/BUILD/python-x2go-0.6.1.3/x2go/__init__.py", line 42, in <module>
    monkey.patch_all()
  File "/usr/lib64/python3.12/site-packages/gevent/monkey.py", line 1279, in patch_all
    patch_ssl(_warnings=_warnings, _first_time=first_time)
  File "/usr/lib64/python3.12/site-packages/gevent/monkey.py", line 200, in ignores
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gevent/monkey.py", line 1044, in patch_ssl
    gevent_mod, _ = _patch_module('ssl', _warnings=_warnings)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gevent/monkey.py", line 462, in _patch_module
    gevent_module, target_module, target_module_name = _check_availability(name)
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gevent/monkey.py", line 448, in _check_availability
    gevent_module = getattr(__import__('gevent.' + name), name)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gevent/ssl.py", line 32, in <module>
    from gevent import _ssl3 as _source # pragma: no cover
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gevent/_ssl3.py", line 53, in <module>
    from ssl import match_hostname
ImportError: cannot import name 'match_hostname' from 'ssl' (/usr/lib64/python3.12/ssl.py)
make: Leaving directory '/builddir/build/BUILD/python-x2go-0.6.1.3/docs'
make: *** [Makefile:53: html] Error 2

match_hostname was deprecated in 3.7 and looks like it was finally removed.

Reproducible: Always

Comment 1 Fedora Release Engineering 2023-08-16 08:11:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 2 Carl George 🤠 2023-09-01 00:00:18 UTC
It looks like the line of code in question (gevent/_ssl3.py line 53) was removed in version 23.7.0 (first that line [0], then the whole file [1]).  That version has already shipped as an update for F39 [2], resolving this bug.

[0] https://github.com/gevent/gevent/commit/d9e2479b83da1a8b2e75720d9bfa771bb97d7c94#diff-3648cb397cc773907437c179050bbfb3aa0bd001fe7b71a50beb7b383860aa22
[1] https://github.com/gevent/gevent/commit/10c84561c58ee58e981a60dcf3c951a8d0e5b89f#diff-3648cb397cc773907437c179050bbfb3aa0bd001fe7b71a50beb7b383860aa22
[2] https://bodhi.fedoraproject.org/updates/FEDORA-2023-cdafc42c52


Note You need to log in before you can comment on or make changes to this bug.