Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when walking an absolute symlinked path with a ROOT_MARKER #65

Open
zsol opened this issue Aug 11, 2022 · 0 comments
Open

Fails when walking an absolute symlinked path with a ROOT_MARKER #65

zsol opened this issue Aug 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@zsol
Copy link

zsol commented Aug 11, 2022

This happens when you fetch a project with a ROOT_MARKER (i.e. .git, .hg, pyproject.toml) into MacOS's system temp.

Easy repro:

tmp=$(mktemp -d)
ln -s "$tmp" foo
touch foo/.git
python -c 'import trailrunner; from pathlib import Path; next(trailrunner.walk(Path.cwd() / "foo"))'

BOOM:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "xxxxlib/python3.11/site-packages/trailrunner/core.py", line 169, in gen
    relative = child.relative_to(root)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "xxxxlib/python3.11/pathlib.py", line 730, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: 'xxxx/foo' is not in the subpath of '/tmp' OR one path is relative and the other is absolute.
@zsol zsol changed the title Fails when walking a symlinked path with a ROOT_MARKER Fails when walking an absolute symlinked path with a ROOT_MARKER Aug 11, 2022
@amyreese amyreese added the bug Something isn't working label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants