From 42896649f9fea26cb4118063aaa99ed2e33df1f0 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 1 Dec 2025 14:50:42 +0100 Subject: [PATCH 1/2] ctypes docs: Note that find_library relies on the programs it runs --- Doc/library/ctypes.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 9c0b246c095483..0c96a56ac751e5 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1388,6 +1388,9 @@ On Linux, :func:`~ctypes.util.find_library` tries to run external programs (``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It returns the filename of the library file. +Note that if the output of these programs does not correspond to the dynamic +linker used by Python, the result of this function may be misleading. + .. versionchanged:: 3.6 On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used when searching for libraries, if a library cannot be found by any other means. From d32ae4c596c3cd5cc0d85bea0d1fc0c6e7d7bb03 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 1 Dec 2025 14:53:14 +0100 Subject: [PATCH 2/2] Link from the other place this is documented. --- Doc/library/ctypes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 0c96a56ac751e5..6038af99009d02 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2135,6 +2135,8 @@ Utility functions The exact functionality is system dependent. + See :ref:`ctypes-finding-shared-libraries` for complete documentation. + .. function:: find_msvcrt() :module: ctypes.util