Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Conversation

bgruening
Copy link
Member

fixes: #110


def is_installed(self):
return os.path.exists(self.involucro_bin)
if find_executable('involucro') is not None or os.path.exists(self.involucro_bin):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distutils.spawn.find_executable only does half the job of shutil.which, i.e., it is only checking for existence but not user executability.
I think (given a shutil.which implementation) you'd want something like

if not os.path.dirname(self.involucro_bin):
    return shutil.which(self.involucro_bin)
return (os.access(self.involucro_bin, os.F_OK | os.X_OK) and not os.path.isdir(self.involucro_bin))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbargull missed that, sorry. Do you think if we find the binary, but it is not executable, that we should install/download a new binary? We should probably error out, isn't it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Faulty path detection for involucro

2 participants