You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible bug introduced with PR250, joinpath with "." causes StopIteration #263
Oh, you shouldn't rely on joinpath to get a materialized path. If what you need is a materialized path on the file system, use as_file(traversable). files() returns a Traversable and Traversable.joinpath also returns a Traversable, which may or may not be on the filesystem. Although depending on your usage, you may not need to materialize the traversable at all and you may be able to get the value directly from the Traversable (such as with .open or .read_text()).
Still, you shouldn't get a StopIteration by attempting to join a path.
Activity
jordan-wirth commentedon Aug 31, 2022
+1, there should be a way to get the Pathlib Path without joinpath anyways.
Also, a workaround for now:
print((files(spacem_maldi.Ontologies) / "fakefilename.txt").parent)VolkerH commentedon Sep 1, 2022
Yes, I felt that
/ "."was a crutch to start with but couln't find a better (proper) way.jaraco commentedon Oct 5, 2022
Oh, you shouldn't rely on
joinpathto get a materialized path. If what you need is a materialized path on the file system, useas_file(traversable).files()returns a Traversable andTraversable.joinpathalso returns a Traversable, which may or may not be on the filesystem. Although depending on your usage, you may not need to materialize the traversable at all and you may be able to get the value directly from the Traversable (such as with.openor.read_text()).Still, you shouldn't get a
StopIterationby attempting to join a path.jaraco commentedon Oct 5, 2022
I'm unable to replicate the issue:
What's special about
spacem_maldi.Ontologiesthat triggers the issue?jaraco commentedon Oct 5, 2022
I thought maybe the issue was that
Ontologieswas a directory without an__init__, but I'm still unable to trigger the failure:jaraco commentedon Dec 4, 2022
Since the issue isn't reproducible, I'm closing it, but feel free to follow-up with the requested info and we can investigate further.