This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Ivan.Pozdeev, eryksun
Date 2014-10-04.02:57:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412391457.24.0.696623551102.issue22552@psf.upfronthosting.co.za>
In-reply-to
Content
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').
History
Date User Action Args
2014-10-04 02:57:37eryksunsetrecipients: + eryksun, Ivan.Pozdeev
2014-10-04 02:57:37eryksunsetmessageid: <1412391457.24.0.696623551102.issue22552@psf.upfronthosting.co.za>
2014-10-04 02:57:37eryksunlinkissue22552 messages
2014-10-04 02:57:36eryksuncreate