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 Michael.Felt
Recipients Michael.Felt, aixtools@gmail.com, martin.panter
Date 2016-12-02.10:23:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480674235.4.0.795737784902.issue27435@psf.upfronthosting.co.za>
In-reply-to
Content
Considering that python-2.7.13 is posed for a release - I ask again, considering that python-2.7.12 (and I expect a few earlier ones) can load "AIX" .a type shared libraries - if you know how to supply the name - 

that my patch be included in python-2.7.13.

michael@x071:[/data/prj/python]-2.7.12.0/Lib/ctypes/util.py                    <
--- python-2.7.12/Lib/ctypes/util.py    2016-06-25 21:49:30 +0000
+++ python-2.7.12.0/Lib/ctypes/util.py  2016-12-02 10:12:01 +0000
@@ -262,6 +262,10 @@
             print cdll.LoadLibrary("libcrypto.dylib")
             print cdll.LoadLibrary("libSystem.dylib")
             print cdll.LoadLibrary("System.framework/System")
+        if sys.platform == "aix5":
+            from ctypes import CDLL
+            RTLD_MEMBER =  0x00040000
+            print CDLL("libc.a(shr_64.o)", RTLD_MEMBER)
         else:
             print cdll.LoadLibrary("libm.so")
             print cdll.LoadLibrary("libcrypt.so")

And the result is:

root@x064:[/data/prj/python/python-2.7.12.0/Lib/ctypes]../../python util.py
None
None
None
<CDLL 'libc.a(shr_64.o)', handle e at 70000000013ae10>

In, other words, as is, find_library() will always return None for standard libraries (will only return a value if "root" has extracted and renamed a shared library member as a file) - while, if you know the magic that find_library cannot return - you can load such a library.

IMVHO (in my Very humble opinion) - a bug that has been too long unnoticed - but can be repaired.

There is no additional ability being added - it is already there. Just making it more accessible and legible for python programmers on AIX.

If the patch-code needs more cleanup, improvement, etc. - fine. But do not lock out an easy interface to such a basic function.

regards,
Michael
History
Date User Action Args
2016-12-02 10:23:55Michael.Feltsetrecipients: + Michael.Felt, martin.panter, aixtools@gmail.com
2016-12-02 10:23:55Michael.Feltsetmessageid: <1480674235.4.0.795737784902.issue27435@psf.upfronthosting.co.za>
2016-12-02 10:23:55Michael.Feltlinkissue27435 messages
2016-12-02 10:23:55Michael.Feltcreate