Author pitrou
Recipients dstufft, eric.araujo, loewis, ncoghlan, pitrou
Date 2014-05-19.18:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za>
In-reply-to
Content
When a C extension is built (using distutils) with a shared library Python, it cannot be loaded with an otherwise identical statically linked Python. The other way round works fine. Trivial example using the _ssl module:

>>> import sys
>>> sys.path.insert(0, '/home/antoine/cpython/shared/build/lib.linux-x86_64-3.5/')
>>> import _ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

This is probably because of an additional -L flag that is passed when linking a C extension with a shared library Python. I don't think the flag is useful under Linux (or perhaps under any other OS at all), since the relevant symbols are already loaded when the interpreter tries to load the C extension.

(AFAIK, systems notorious for providing shared library Pythons are RedHat-alike systems, while Debian/Ubuntu provide statically linked Pythons)
History
Date User Action Args
2014-05-19 18:50:02pitrousetrecipients: + pitrou, loewis, ncoghlan, eric.araujo, dstufft
2014-05-19 18:50:02pitrousetmessageid: <1400525402.57.0.75792320709.issue21536@psf.upfronthosting.co.za>
2014-05-19 18:50:02pitroulinkissue21536 messages
2014-05-19 18:50:00pitroucreate