Resolve package root in inspect.member() before containment checks #2
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!2
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Batushn on GitHub · 2026-11-23 20:05 UTC · original
Batushn:fix/inspect-resolve-root→main· +24 −0 · 2 files · 1 commits · merged 2026-11-23 20:20 UTCSummary
root = Path(root).resolve()at the start ofproject_tuxbox.inspect.member().tests/test_inspect.pyverifying unresolved/relative package roots work in bothmember()andmanifest()while symlinks escaping the package directory are still rejected.Why
member()resolved each matched path (folder = matches[0].resolve()) and checkedfolder.is_relative_to(root), without resolvingrootfirst. Callers passing an unresolved path tomember()ormanifest()? such as a relative directory, a path with.., a symlinked/junctioned package directory, or a Windows 8.3 short temp path ? hit a falseValueError: Package member leaves the package directory.Verification
python -m unittest tests/test_inspect.py tests/test_package_binaries.py -von Windows (Python 3.12.10): 13 tests, all non-skipped tests pass (test_case_collisionskipped on case-insensitive FS).member(Path("."), "README.md")previously raisedValueErrorand now resolves cleanly.(Disclosure: assisted by an AI coding agent; all changes were reviewed and verified locally.)
buffer-remapregression control fails on RADV, with host memory imports refused #191