Use sys.executable in command.run_command for version-independent execution.
#17
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.
One problem I found recently when trying to use Fildem on my Ubuntu 22.10 install, after installing Python 3.11 from
aptand setting a symlink frompython3.11-->python3, was that when executingfildem, Python would raise aModuleNotFoundErrorforfildem. This would happen even if I reinstalled Fildem explicitly usingpython3.10.Having a look at the source code, I realised that this error most likely occurs due to the command being specified for the secondary Fildem thread in
command.run_commandusing thepython3executable set in the system'sPATH, which may not match the version of Python 3 used to install Fildem. To fix this, the code now replaces the call topython3withsys.executableinstead, which provides an absolute path to the Python 3 executable used at runtime.Testing this on my system, this appears to have fixed the issue.