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
Date 2016-02-25.16:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Further testing...

I added an extremely simple hack in so that a archive (AIX library) name got returned.

Also in this case - the     print cdll.LoadLibrary("libc.a") fails.

   +74  if == "posix" and sys.platform == "darwin":
   +75      from ctypes.macholib.dyld import dyld_find as _dyld_find
   +76      def find_library(name):
   +77          possible = ['lib%s.dylib' % name,
   +78                      '%s.dylib' % name,
   +79                      '%s.framework/%s' % (name, name)]
   +80          for name in possible:
   +81              try:
   +82                  return _dyld_find(name)
   +83              except ValueError:
   +84                  continue
   +85          return None
   +87  if == "posix" and sys.platform.startswith("aix"):
   +88       def find_library(name):
   +89          expr = "lib" + name + ".a"
   +90          return expr
   +92  elif == "posix":
   +93      # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
   +94      import re, tempfile, errno
   +96      def _findLib_gcc(name):

  +275          else:
  +276              print cdll.LoadLibrary("libc.a")
  +277              print cdll.LoadLibrary("")
  +278              print cdll.LoadLibrary("")

root@x064:[/tmp]python -m ctypes.util
Traceback (most recent call last):
  File "/opt/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/opt/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/opt/lib/python2.7/ctypes/", line 282, in <module>
  File "/opt/lib/python2.7/ctypes/", line 276, in test
    print cdll.LoadLibrary("libc.a")
  File "/opt/lib/python2.7/ctypes/", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/opt/lib/python2.7/ctypes/", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError:        0509-022 Cannot load module /usr/lib/libc.a.
        0509-103   The module has an invalid magic number.

So, what needs to be returned so that cdll.LoadLibrary could use that result? (e.g., I know that the default libm.a has no shared members on AIX 5.3 TL7 - but libc.a does (shr.o and more, but not all!).
Date User Action Args
2016-02-25 16:08:47Michael.Feltsetrecipients: + Michael.Felt
2016-02-25 16:08:47Michael.Feltsetmessageid: <>
2016-02-25 16:08:47Michael.Feltlinkissue26439 messages
2016-02-25 16:08:46Michael.Feltcreate