Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6439)

Delta Between Two Patch Sets: Doc/library/ctypes.rst

Issue 21042: ctypes.util.find_library() should return full pathname instead of filename in linux
Left Patch Set: Created 3 years, 8 months ago
Right Patch Set: Created 3 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/ctypes/test/test_find.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 :mod:`ctypes` --- A foreign function library for Python 1 :mod:`ctypes` --- A foreign function library for Python
2 ======================================================= 2 =======================================================
3 3
4 .. module:: ctypes 4 .. module:: ctypes
5 :synopsis: A foreign function library for Python. 5 :synopsis: A foreign function library for Python.
6 .. moduleauthor:: Thomas Heller <theller@python.net> 6 .. moduleauthor:: Thomas Heller <theller@python.net>
7 7
8 8
9 :mod:`ctypes` is a foreign function library for Python. It provides C compatibl e 9 :mod:`ctypes` is a foreign function library for Python. It provides C compatibl e
10 data types, and allows calling functions in DLLs or shared libraries. It can be 10 data types, and allows calling functions in DLLs or shared libraries. It can be
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 be found, returns ``None``. 1249 be found, returns ``None``.
1250 1250
1251 The exact functionality is system dependent. 1251 The exact functionality is system dependent.
1252 1252
1253 On Linux, :func:`find_library` tries to run external programs 1253 On Linux, :func:`find_library` tries to run external programs
1254 (``/sbin/ldconfig``, ``gcc``, and ``objdump``) to find the library file. It 1254 (``/sbin/ldconfig``, ``gcc``, and ``objdump``) to find the library file. It
1255 returns the absolute path of the library file. Here are some examples:: 1255 returns the absolute path of the library file. Here are some examples::
1256 1256
1257 >>> from ctypes.util import find_library 1257 >>> from ctypes.util import find_library
1258 >>> find_library("m") 1258 >>> find_library("m")
1259 '/lib/i386-linux-gnu/libm.so.6' 1259 '/lib/x86_64-linux-gnu/libm.so.6'
1260 >>> find_library("c") 1260 >>> find_library("c")
1261 '/lib/i386-linux-gnu/libc.so.6' 1261 '/lib/x86_64-linux-gnu/libc.so.6'
1262 >>> find_library("bz2") 1262 >>> find_library("bz2")
1263 '/lib/x86_64-linux-gnu/libbz2.so.1.0' 1263 '/lib/x86_64-linux-gnu/libbz2.so.1.0'
1264 >>> 1264 >>>
1265 1265
1266 On OS X, :func:`find_library` tries several predefined naming schemes and paths 1266 On OS X, :func:`find_library` tries several predefined naming schemes and paths
1267 to locate the library, and returns a full pathname if successful:: 1267 to locate the library, and returns a full pathname if successful::
1268 1268
1269 >>> from ctypes.util import find_library 1269 >>> from ctypes.util import find_library
1270 >>> find_library("c") 1270 >>> find_library("c")
1271 '/usr/lib/libc.dylib' 1271 '/usr/lib/libc.dylib'
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 .. function:: find_library(name) 1822 .. function:: find_library(name)
1823 :module: ctypes.util 1823 :module: ctypes.util
1824 1824
1825 Try to find a library and return a pathname. *name* is the library name 1825 Try to find a library and return a pathname. *name* is the library name
1826 without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version 1826 without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version
1827 number (this is the form used for the posix linker option :option:`-l`). If 1827 number (this is the form used for the posix linker option :option:`-l`). If
1828 no library can be found, returns ``None``. 1828 no library can be found, returns ``None``.
1829 1829
1830 The exact functionality is system dependent. 1830 The exact functionality is system dependent.
1831 1831
1832 .. versionchanged:: 3.5 1832 .. versionchanged:: 3.6
1833 On Linux it returns an absolute path. 1833 On Linux it returns an absolute path.
1834 1834
1835 1835
1836 .. function:: find_msvcrt() 1836 .. function:: find_msvcrt()
1837 :module: ctypes.util 1837 :module: ctypes.util
1838 1838
1839 Windows only: return the filename of the VC runtime library used by Python, 1839 Windows only: return the filename of the VC runtime library used by Python,
1840 and by the extension modules. If the name of the library cannot be 1840 and by the extension modules. If the name of the library cannot be
1841 determined, ``None`` is returned. 1841 determined, ``None`` is returned.
1842 1842
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 2450
2451 .. attribute:: _type_ 2451 .. attribute:: _type_
2452 2452
2453 Specifies the type pointed to. 2453 Specifies the type pointed to.
2454 2454
2455 .. attribute:: contents 2455 .. attribute:: contents
2456 2456
2457 Returns the object to which to pointer points. Assigning to this 2457 Returns the object to which to pointer points. Assigning to this
2458 attribute changes the pointer to point to the assigned object. 2458 attribute changes the pointer to point to the assigned object.
2459 2459
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+