use sys.executable - #68
Conversation
|
How to add PR labels? |
| system_python = "/usr/bin/python%s" % ".".join( | ||
| [str(item) for item in platform.python_version_tuple()[0:2]] | ||
| ) | ||
| system_python = sys.executable |
There was a problem hiding this comment.
This will break badly as it will pick a local python when run from within a virtualenv, and it fail to discover the system python, which is likely the only one that might have the _selinux binary extension installed.
There was a problem hiding this comment.
I wrote a more elaborate fix, is this one acceptable?
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I rewrote my PR to look for |
|
BTW, this now also adds support for virtualenvs |
|
@ssbarnea Do you have any plans of merging this? |
|
This ( |
|
Hi. I think this is working because it's reloading on itself and the check for If I'm understanding correctly, this shim library should reload using selinux bindings if they are installed. If this is correct, I understand why we cannot merge this. Please correct me if I'm wrong. ps: I also looking for a solution to this problem. I can help if you guys let me. |
|
ansible now from version 8, loads selinux differently. Basically it's using ctypes to get the .so I might understand why the main developers haven't payed attention to this PR |
|
Can someone please get this reviewed and merged?!! #17 not only fixed virtualenv setups, but broke more standard installs such as those done from source, which install under /usr/local/bin by default (and might even break RHEL SCL installs which would install under /opt/rh... I have just started using those, so have not checked). See my comment on #69 for more info. |
Fixed nasty bug