Skip to content

Conversation

@TLCFEM
Copy link
Contributor

@TLCFEM TLCFEM commented Jan 19, 2026

Fixes: #1974 #1975

Copy link
Member

@martindurant martindurant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just a couple of simple questions.

raise ValueError("maxdepth must be at least 1")

def to_parts(_path: str):
return list(filter(None, _path.replace("\\", "/").split("/")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"\" is a single slash because of escaping - is that the intent?

Copy link
Contributor Author

@TLCFEM TLCFEM Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, '\' needs to be escaped otherwise using r'\' should be equivalent.

def _matching_starts(file_path):
file_parts = filter(lambda s: bool(s), file_path.split("/"))
return all(a == b for a, b in zip(path_parts, file_parts))
path_depth = len(path_parts := to_parts(path))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it clearer to write out

Suggested change
path_depth = len(path_parts := to_parts(path))
path_parts = to_parts(path)
path_depth = len(path_parts)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@martindurant martindurant merged commit 635b2ef into fsspec:master Jan 20, 2026
10 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.

ZipFileSystem incorrect results .find() with withdirs=True

2 participants