Skip to content

ctypes dlopen failed when use no-gil mode on Android #140041

@pawanake2333

Description

@pawanake2333

Bug report

Bug description:

File "python/lib/python3.14t/platform.py", line 1127, in machine
    return uname().machine
           ~~~~~^^
File "python/lib/python3.14t/platform.py", line 1070, in uname
    release = android_ver().release
              ~~~~~~~~~~~^^
File "python/lib/python3.14t/platform.py", line 596, in android_ver
    from ctypes import CDLL, c_char_p, create_string_buffer
File "python/lib/python3.14t/ctypes/__init__.py", line 553, in <module>
    pythonapi = PyDLL("libpython%d.%d.so" % _sys.version_info[:2])
File "python/lib/python3.14t/ctypes/__init__.py", line 462, in __init__
    self._handle = _dlopen(self._name, mode)
                   ~~~~~~~^^^^^^^^^^^^^^^^^^
OSError: dlopen failed: library "libpython3.14.so" not found

I compiled Python 3.14 with the no-gil mode. In this mode, the Python library file is named 'libpython3.14t.so', but ctypes internally still tries to load 'libpython3.14.so', which causes an error.

CPython versions tested on:

3.14

Operating systems tested on:

Other

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions