Michael Felt added the comment:

I cannot comment on uuid directly, but for me, this is yet another example of 
how assumptions can break things.

imho - if you know the exact version of s shared library that you want, calling 
cdll directly should be find. Maybe find_library is historic.

However, an advantage to calling find_library is that it should lead to an 
OSError if it cannot be loaded. But trapping OSError on a call to ctypes.cdll 
or testing for None (NULL) from find_library() is the option of a developer 
using the ctypes interface.

As far as libFOO.so.N - do you always want to assume it is going to be version 
N, or are you expecting to be able to work work version N+X?
Again, find_library() can give you the library name it would load - but a 
programmer must be aware of the platform differences (e.g., AIX returns not a 
filename, but a libFOO.a(libFOO.so.N) - as just one example.
p.s. as far as ldconfig being part of the problem on AIX (as it does not exist 
and can lead to OSError or just long delays, I have worked out a (pending) 
patch for ctypes/util (and ctypes/cdll) that may address the issues with uuid 
import on AIX. (see issue26439 for the patch)

----------
nosy: +Michael.Felt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11063>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to