eryksun added the comment:
The ctypes global LibraryLoader instances are convenient for Windows scripts
and applications. Actually what they cache is the library (a CDLL instance),
which in turn caches function pointers.
Python packages, on the other hand, shouldn't use these particular loaders. As
you've experienced, doing so can lead to conflicting definitions for restype,
argtypes, and errcheck. Instead create a private loader such as cdll =
LibraryLoader(CDLL), or windll = LibraryLoader(WinDLL).
Doing this would be pretty much pointless on non-Windows platforms. To gain the
benefit of the cache you'd have to use subscripting such as cdll['libc.so.6'].
It's simpler to use libc = CDLL('libc.so.6').
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22552>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com