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

Fix nested subdirectory listing #1430 #1433

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

Kirill888
Copy link
Contributor

Walking up the directory tree never went higher than one directory up:

For example A/B/C, would register A/B/C -> A/B, but not A/B -> A, due to this line

self.dircache.setdefault(
par0.rsplit("/", 1)[0] if "/" in par0 else "", []
).append({"name": par0, "type": "directory", "size": 0})

The solution is to first collect all the newly observed sub-directories, and only then update dircache with new directory entries.

In the previous code walking up the directory tree never
went more than 1 directory level up due to logic error.
@Kirill888 Kirill888 changed the title Fix 1430 Fix nested subdirectory listing #1430 Nov 16, 2023
@martindurant martindurant merged commit d1d2268 into fsspec:master Nov 20, 2023
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.

Missing sub-directories when listing root in ReferenceFileSystem
2 participants