-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ctypes.util.find_library not working on macOS #77462
Comments
On Python 3.7.0a4 and later (including 3.7.0b4), find_library currently always returns None on macOS. It works on 3.7.0a3 and earlier. Tested on macOS 10.11 and 10.13. Expected result: Tested on 3.6.5, 3.7.0a1 and 3.7.0a3: >>> from ctypes.util import find_library
>>> find_library('iconv')
'/usr/lib/libiconv.dylib'
>>> find_library('c')
'/usr/lib/libc.dylib'
>>> Current output on 3.7.0a4 to 3.7.0b3:
|
On 15/04/2018 07:56, Ned Deily wrote:
Perhaps he can give a bit more info. I do not understand how this could if os.name == "posix" and sys.platform == "darwin":
from ctypes.macholib.dyld import dyld_find as _dyld_find
def find_library(name):
possible = ['lib%s.dylib' % name,
'%s.dylib' % name,
'%s.framework/%s' % (name, name)]
for name in possible:
try:
return _dyld_find(name)
except ValueError:
continue
return None
if sys.platform.startswith("aix"):
# AIX has two styles of storing shared libraries
# GNU auto_tools refer to these as svr4 and aix
# svr4 (System V Release 4) is a regular file, often with .so as suffix
# AIX style uses an archive (suffix .a) with members (e.g., shr.o,
libssl.so)
# see issue#26439 and _aix.py for more details from ctypes._aix import find_library elif os.name == "posix": def _findLib_gcc(name): As I understand the code above (and maybe I am wrong) - the code should if sys.platform.startswith("aix"):
from ctypes._aix import find_library That will "delete" the AIX find_library logic. In other words - can someone check whether the unchanged
|
Thanks for the PR, Ray. Merged for 3.7.0b4 (and 3.8.0). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: