Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(utils): resolve binaries installed in the same venv/uv-tool bin#6

Merged
SonoTommy merged 1 commit into
OpenOSINT:mainOpenOSINT/OpenOSINT:mainfrom
consocio:fix/venv-bin-tool-discoveryconsocio/OpenOSINT:fix/venv-bin-tool-discoveryCopy head branch name to clipboard
Jun 2, 2026
Merged

fix(utils): resolve binaries installed in the same venv/uv-tool bin#6
SonoTommy merged 1 commit into
OpenOSINT:mainOpenOSINT/OpenOSINT:mainfrom
consocio:fix/venv-bin-tool-discoveryconsocio/OpenOSINT:fix/venv-bin-tool-discoveryCopy head branch name to clipboard

Conversation

@consocio
Copy link
Copy Markdown

@consocio consocio commented Jun 1, 2026

Problem

When OpenOSINT is installed via uv tool install, it runs inside an isolated virtual environment. Tools like holehe or phoneinfoga can be installed into that same environment (e.g. uv pip install holehe --python <venv-python>), but shutil.which() only searches the system PATH — not the venv's bin/ directory. This causes a spurious ToolNotFoundError even when the binary is present and working.

Symptom:

Email scan failed: 'holehe' is not installed or not in PATH. Install it with: pip install holehe

Fix

Prepend the directory of the running Python executable (sys.executable) to the search path before calling shutil.which(). This ensures any binary co-installed in the same venv or uv-tool environment is always resolved, regardless of the user's system PATH.

venv_bin = str(Path(sys.executable).parent)
search_path = os.pathsep.join([venv_bin, os.environ.get("PATH", "")])
binary = shutil.which(binary, path=search_path) or binary

Impact

  • No behaviour change when binaries are already on the system PATH.
  • Fixes discovery for binaries installed inside the venv (common with uv tool install).
  • Affects all tool wrappers that use run_subprocess() (holehe, phoneinfoga, sherlock, sublist3r, etc.).

🤖 Generated with Claude Code

shutil.which() only searches the system PATH, so tools like holehe or
phoneinfoga installed inside the same virtual environment (e.g. via
`uv tool install`) were never found, causing a spurious ToolNotFoundError.

The fix prepends the directory of the running Python executable to the
search path before calling shutil.which(), so co-installed binaries are
always resolved regardless of the user's PATH.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SonoTommy added a commit that referenced this pull request Jun 2, 2026
…(thanks @consocio)

Prepends the directory of sys.executable to the shutil.which search path in
run_subprocess() so tools co-installed in the same venv (holehe, sherlock,
phoneinfoga, sublist3r) are found even when the venv bin is not on PATH.

Also fixes 12 test monkeypatches that were silently broken by the new
path= kwarg, and adds two unit tests covering the new resolution logic.
@SonoTommy SonoTommy merged commit 16ecee9 into OpenOSINT:main Jun 2, 2026
@SonoTommy
Copy link
Copy Markdown
Member

SonoTommy commented Jun 2, 2026

@consocio Merged, thank you. Clean fix — and reviewing it surfaced a latent bug in our own test mocks, so this helped more than the three lines suggest. The merge ended up attributing the commit to me rather than you, which wasn't intended — full credit is yours, and I've made sure you're credited in the CHANGELOG, the README contributors section, and the release notes. Affects everyone installing via uv. Appreciate it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.