fsspec / fsspec/filesystem_spec

Walk filesystem breaks if filesystem doesn't provide unique file names

Open
#1,647 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

If the filesystem provides files with same name at different directory then it breaks for example with HTTPFilesystem if the response is as follows:

"/folder1/file"
"/folder2/file"

Then it will only return the first file because the current implementation appears to assign them to the same key in a dictionary when walking and will only return the first one meaning I need to generate a unique file name for all of them.

Since HTTPFilesystem uses walk to implement glob this also means glob doesn't work

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the filesystem walk implementation and HTTPFilesystem's glob path, using the two example paths as a reproduction. Check how entries are collected when different directories contain the same filename. Done means walk preserves both paths and glob no longer loses one of them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.