Issue #21042: Return full path in ctypes.util.find_library() on Linux

Patch by Tamás Bence Gedai.
This commit is contained in:
Martin Panter 2016-03-10 01:06:23 +00:00
parent aadaa3614e
commit b9f3114d42
5 changed files with 37 additions and 22 deletions

View file

@ -1252,15 +1252,15 @@ The exact functionality is system dependent.
On Linux, :func:`find_library` tries to run external programs
(``/sbin/ldconfig``, ``gcc``, and ``objdump``) to find the library file. It
returns the filename of the library file. Here are some examples::
returns the absolute path of the library file. Here are some examples::
>>> from ctypes.util import find_library
>>> find_library("m")
'libm.so.6'
'/lib/x86_64-linux-gnu/libm.so.6'
>>> find_library("c")
'libc.so.6'
'/lib/x86_64-linux-gnu/libc.so.6'
>>> find_library("bz2")
'libbz2.so.1.0'
'/lib/x86_64-linux-gnu/libbz2.so.1.0'
>>>
On OS X, :func:`find_library` tries several predefined naming schemes and paths
@ -1829,6 +1829,9 @@ Utility functions
The exact functionality is system dependent.
.. versionchanged:: 3.6
On Linux it returns an absolute path.
.. function:: find_msvcrt()
:module: ctypes.util