-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
use sys.executable #68
base: main
Are you sure you want to change the base?
Conversation
How to add PR labels? |
selinux/__init__.py
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Fixed nasty bug