Repository navigation
Conversation
This reverts commit 2410756.
Owner
Author
|
@filmor The latest commit tries what I mentioned. Ubuntu now passes. I don't think your fix quite works. I'll merge this soon. I have to do some work in cygwin to get this same procedure with dl_info to work in msys2 environments. |
The previous implementation only checked `ctypes.pythonapi`, which depending on how the Python was configured could return a handle to the executable or libpython. Attempts to filter out the executable and fall back on other methods didn't work. Instead, we use the candidate names to try loading the library and use dladdr to obtain the filepath.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #15.
@filmor Looks like it's still returning the executable on Ubuntu... I would think
ctypes.pythonapiwould be the executable even if it's--enable-sharedbecause why load another library?I think I'll come back to this by doing trial loading of candidate library names with
ctypes.CDLLand passing the handle of libraries that succeed loading to this function. And not testctypes.pythonapi.It also almost works in msys2. Msys2 assumes dl_info.fname field is a unicode buffer unlike Unix where that info is static. I still get an empty name back after accounting for that, it requires more testing.