Message228426
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'). |
|
Date |
User |
Action |
Args |
2014-10-04 02:57:37 | eryksun | set | recipients:
+ eryksun, Ivan.Pozdeev |
2014-10-04 02:57:37 | eryksun | set | messageid: <1412391457.24.0.696623551102.issue22552@psf.upfronthosting.co.za> |
2014-10-04 02:57:37 | eryksun | link | issue22552 messages |
2014-10-04 02:57:36 | eryksun | create | |
|