GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — Fix Pipenv remedy for base-interpreter copies (#1450) by mikolalysenko · Pull Request #1455 · SocketDev/socket-patch Conversation
|
| Issue | Regression test | Red without fix | Green with fix |
|---|---|---|---|
| #1450 (vendored) | vendor::pypi::tests::pipenv_stale_install_in_a_base_site_dir_installs_over_it |
FAILED (panicked at pypi.rs:4275, generic remedy printed) | ok |
| #1450 (hosted) | commands::scan::hosted::python::tests::pipenv_base_site_copy_gets_an_install_over_it |
FAILED (panicked at python.rs:453) | ok |
| helper | crawlers::python_crawler::tests::inherited_base_site_dirs_are_the_base_interpreters, vendor::pypi_pipenv::tests::base_site_stale_install_remedy_installs_over_the_base_copy |
new API | ok |
To get the red runs, I kept the new tests and stubbed the callers' inherited set to empty.
Real Pipenv 2026.8.0 check (Linux, py3.11, six 1.16.0 in /usr/lib/python3/dist-packages, PIPENV_SITE_PACKAGES=1):
pipenv run pip uninstall -y six → Not uninstalling six at /usr/lib/python3/dist-packages, outside environment …. This reproduces the issue.<venv>/lib/python3.11/site-packages/six.py, and the base copy is unchanged."file": "./.socket/vendor/pypi/<uuid>/six-1.16.0-py2.py3-none-any.whl"): pipenv requirements exports the relative wheel path, pip installs it, and the venv imports its own copy.Local runs:
cargo fmt --all -- --check: ok.cargo clippy --workspace --all-features -- -D warnings: ok.cargo test -p socket-patch-cli --all-features --lib: 919 passed.cargo test -p socket-patch-core --all-features --lib: 6410 passed, 4 failed. The 4 failures are copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure… and pypi_requirements::wire_failure_rolls_back…. Each relies on chmod 0555 making a write fail, which can't happen as uid 0 in this container. This diff doesn't touch them.--test in_process_redirect_pipenv --test mode_migration_pypi: 11 + 61 passed.cargo test --workspace ran out of the container's disk allowance, so CI covers the rest./code-review high)--hash to pipenv requirements: I didn't. pipenv requirements --hash exports the vendored wheel line without its hash (Vendored Pipenv lock breaks pipenv requirements --hash | pip install -r on Pipenv 2023+: the vendored wheel is exported without a hash, so pip's hash-checking mode refuses the whole install #981; I confirmed this on 2026.8.0), so pip's hash-checking mode would refuse the whole vendored install. The hosted and vendored artifacts are the ones the lock already names.pipenv requirements doesn't exist there, and I couldn't verify that pipenv lock -r leaves the lock alone on those releases, so the text says "Pipenv 2022.4+" (2022.12+ when --categories is needed; I checked that 2022.4.8 lacks it and 2022.12.19 has it).vex --product <purl> vs vex), and unifying them would change unrelated text.stale_install_sites already recomputes the search order per purl the same way. It's a handful of pyvenv.cfg reads.--system-site-packages venv, pip keeps the base interpreter's unpatched copy after a hosted rewrite, no stale-install warning fires, and vex attests it as patched #409 (venv site-packages comes before the user site), so nothing to change.--hash: unchanged, for the reason above.🤖 Generated with Claude Code
https://claude.ai/code/session_01YCidp2ZuBQK2S7rDd2fvBM
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
When a --site-packages Pipenv virtualenv imports a package from its base interpreter (e.g. Debian's /usr/lib/python3/dist-packages), the stale-install warning told users to `pip uninstall` it and re-sync, or to recreate the virtualenv. pip refuses to remove a copy outside the venv and `pipenv sync` counts it as installed, so both left the package unpatched and the next scan printed the same advice. Hosted and vendored scans now tell a base-interpreter copy apart from the venv's own and, for one, print an install over it inside the venv (`pipenv requirements ... && pipenv run pip install --no-deps --ignore-installed -r ...`) instead, without claiming the lock protects fresh installs on that host. Fixes #1450 Assisted-by: Claude Code:claude-opus-5-5
Address review of the base-interpreter remedy: - When one Pipenv venv has its own stale copy and another imports the base interpreter's, the vendored warning now gives each dir its own remedy instead of only the base one. - Hosted scans no longer treat a base dir that only a Hatch env reaches as Pipenv's, and skip the probe when no Pipenv package is involved. - The remedy notes that `--categories` needs Pipenv 2022.12+ and tells users to delete the exported requirements file afterwards. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Hosted scans skipped every venv Hatch also claims when looking for inherited base-interpreter dirs, so a `.venv` Pipenv shares with Hatch (`path = ".venv"`) still got the uninstall-and-sync advice that cannot replace a base copy. Use Pipenv's own venv list, as the vendored warning does. The install-over remedy now also says that it reinstalls every package of the named lock categories, not only the stale one. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does: When a Risk: low. Only warning text changes; nothing is written to disk and no patch logic moves. The extra filesystem work runs only when Pipenv venvs are present. Look here:
Verified:
Changes I made: none. Open questions (non-blocking; the PR fixes the reported base-only case and regresses nothing):
Auto-merge (squash) is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When a `--site-packages` Pipenv venv's own stale copy hides the same release in its base interpreter, the usual `pip uninstall && pipenv sync` remedy only exposed the base copy: `pipenv sync` counts it as installed, so the venv went on importing the unpatched base copy and the warning came back. Both the hosted and vendored warnings now give that copy the install-over remedy too. A different base release keeps the usual remedy, since `pipenv sync` installs the locked one over it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YCidp2ZuBQK2S7rDd2fvBM
There was an error while loading. Please reload this page.
|
[agent] Replies to the open questions in the final review:
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 76d2473. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review brief (updated for 76d2473)What it does: A Risk: low. Only warning text changes; nothing is written to disk. A case that doesn't match exactly falls back to the old remedy. Look here:
Verified:
Changes I made: none. I disarmed auto-merge when 76d2473 landed after the earlier brief, and I re-armed it with this brief. Open questions (non-blocking):
Auto-merge (squash) is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Still Ready for review at Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Pipenv stale-install remedy can't replace a base-interpreter copy in a--site-packages venv: pip uninstall refuses it and pipenv sync keeps it, so following the warning leaves the package unpatched
There was an error while loading. Please reload this page.