Skip to content

fix: allow read-only global list with inaccessible locks - #1975

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
yangfan-yf-yf:fix/read-only-global-list-lock
Jul 26, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
yangfan-yf-yf:fix/read-only-global-list-lock

Conversation

@yangfan-yf-yf

Copy link
Copy Markdown
Contributor

Summary

Why

Global venvs installed by root can leave lock files that non-root users cannot open. pipx list --global then fails before it reads any installed environment.

Validation

  • Targeted Ruff check and format check passed.
  • Verified the read-only fallback with a mocked inaccessible lock, including successful list rendering.
  • Verified the normal lock acquisition and release lifecycle.
  • git diff --check passed.
  • The full pytest suite did not complete locally before test initialization timed out; upstream CI will exercise the full suite and Linux permissions behavior.

Checklist

  • Ran pre-commit run --all-files (not run locally; targeted Ruff checks passed).
  • Wrote descriptive pull request text.
  • Added a regression test.
  • Added changelog.d/1974.bugfix.md.
  • Documentation update is not needed for this read-only failure path.

@yangfan-yf-yf
yangfan-yf-yf marked this pull request as ready for review July 24, 2026 09:37
@gaborbernat
gaborbernat enabled auto-merge (squash) July 26, 2026 23:14
@gaborbernat
gaborbernat merged commit 6b2f323 into pypa:main Jul 26, 2026
16 checks passed
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