Skip to content

Remove testing of linked libpython - #15

Merged
ktbarrett merged 1 commit into
masterfrom
remove-linked-libpython
Feb 7, 2021
Merged

ktbarrett merged 1 commit into
masterfrom
remove-linked-libpython

Conversation

@ktbarrett

Copy link
Copy Markdown
Owner

I don't know of an environment this works correctly on, so I'm removing it as maintainance baggage.

I don't know of an environment this works correctly on, so I'm removing
it as maintainance baggage.
@ktbarrett
ktbarrett merged commit c049253 into master Feb 7, 2021
@ktbarrett
ktbarrett deleted the remove-linked-libpython branch February 7, 2021 21:15
@filmor

filmor commented Feb 22, 2021

Copy link
Copy Markdown

This code works just fine for the most part (the only odd case I have run into is pythonnet/pythonnet#1388, and that is mainly about how dladdr deals with the calling executable, which is not necessarily the same as what the shell thinks). Is there anything particular that you think doesn't work correctly?

@ktbarrett

Copy link
Copy Markdown
Owner Author

I didn't see it work correctly. On Debian with the system Python distribution and Linux conda it returned {cwd}/python, like in the issue you posted, which put the code into "dubious" territory to me. I will admit I didn't try hunting the issue down. After realizing that most Linux's Python configurations were fairly consistent and the code wasn't necessary to find libpython, I decided to remove it. Most Python distributions on Unix-like systems have a statically linked Python executable (for speed and packaging reasons) and this method will rarely return libpython, and we don't want it to return the Python executable.

Is there an environment that is broken without this function? I'd be willing to add it back with your fix if there is.

@filmor

filmor commented Feb 22, 2021

Copy link
Copy Markdown

Well, on Windows it is always the case, and even on Linux people may decide to use this configuration. The way I fixed it (not tested yet) in our vendored copy is to check the sysconfig for Py_ENABLE_SHARED on Unix:

https://github.com/pythonnet/pythonnet/pull/1396/files#diff-b7042a96778615513ad593538de3b95134b5a8be6da827a843a5f00ba9d553ca

@ktbarrett

Copy link
Copy Markdown
Owner Author

Thanks, I'll keep it in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants