[New-bugs-announce] [issue4861] fix problems with ctypes.util.find_library

Matthias Klose report at bugs.python.org
Tue Jan 6 23:02:52 CET 2009


New submission from Matthias Klose <doko at debian.org>:

there are some problems with ctypes.util.find_library(), which I would
like to see fixed on active branches.

 - find_library is not robust, if either objdump or gcc are not
   installed. fixed by raising an exception if the tools are not
   found. Is OSError the correct type for this exception?

 - ldconfig -p already prints the shared object name. afaics there
   is no need to call objdump again.

 - the regexp to scan the ldconfig -p output is wrong for
   architectures where libraries of more than one abi type are
   installed, e.g. having ix86 libs on a x86_64 system. Having
   only the library installed which doesn't match the python
   executable lets find_library find the wrong library. Note that
   the patch is only correct under the assumption that the python
   executable is unstalled for the "main" abi.

patch attached, ok to check in?

----------
assignee: theller
components: ctypes
files: ctypes-findlib.diff
keywords: patch, patch
messages: 79294
nosy: doko, theller
severity: normal
status: open
title: fix problems with ctypes.util.find_library
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12626/ctypes-findlib.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4861>
_______________________________________


More information about the New-bugs-announce mailing list