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 lemburg
Recipients Arfrever, larry, lemburg, mark.dickinson, rhettinger, skrah
Date 2013-10-18.10:02:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5261072D.9030009@egenix.com>
In-reply-to <20131018093956.GA8774@sleipnir.bytereef.org>
Content
On 18.10.2013 11:39, Stefan Krah wrote:
> 
> Stefan Krah added the comment:
> 
> I believe you, but I'd like to understand why. :)

:-)

> It seems to me that a module and also PyInit_xxx() can be loaded portably.
> Say the handles to the module are cached somewhere after loading and
> initializing.  I think this already happens in Python/dynload_shlib.c.
> 
> Why can't another module use a slightly modified form of _PyImport_GetDynLoadFunc()
> to get any non-static function apart from PyInit_xxx() by re-using the cached
> handle?

This may work on Linux (and probably does if you use the right
DL flags), but I don't think this works reliably or at all on other
platforms such as Windows. Symbols from shared libs are not necessarily
available to all other shared libraries in the same process.

CObjects, which Capsules originate from, were added to address this
problem in a portable way. It's the Python standard approach to
"importing" C APIs from other extension modules.
History
Date User Action Args
2013-10-18 10:02:10lemburgsetrecipients: + lemburg, rhettinger, mark.dickinson, larry, Arfrever, skrah
2013-10-18 10:02:10lemburglinkissue15237 messages
2013-10-18 10:02:09lemburgcreate