Fildem-v2 icon indicating copy to clipboard operation
Fildem-v2 copied to clipboard

Use `sys.executable` in `command.run_command` for version-independent execution.

Open cpolish opened this issue 1 year ago • 0 comments

One problem I found recently when trying to use Fildem on my Ubuntu 22.10 install, after installing Python 3.11 from apt and setting a symlink from python3.11 --> python3, was that when executing fildem, Python would raise a ModuleNotFoundError for fildem. This would happen even if I reinstalled Fildem explicitly using python3.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_command using the python3 executable set in the system's PATH, which may not match the version of Python 3 used to install Fildem. To fix this, the code now replaces the call to python3 with sys.executable instead, 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.

cpolish avatar Apr 07 '23 10:04 cpolish