fsspec / fsspec/s3fs

Empty directory in aws key breaks listdir api.

Open
#770 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
305
Avg merge
22h 37m
Merged PRs (30d)
4

Description

Example: s3://test_bucket//test_path

The double slash '//' is valid part of the key, we were able to validate that for a customer. But due to lstrip in core.py on key, s3 will fail to list without this exact string.

Current behavior

s3.listdir("s3://test_bucket//test_path") -> []

Expected behavior

s3.listdir("s3://test_bucket//test_path") -> [{'Key': 'test_bucket//test_path/dir1', 'Size': 0, 'StorageClass': 'DIRECTORY', 'type': 'directory', 'size': 0, 'name': 'test_bucket//test_path/dir1'}
]

Contributor guide

Open the contributing guide

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 in core.py and trace the key handling used by the listdir API for the issue's s3://test_bucket//test_path example. Reproduce the current empty result and verify that listing preserves the double slash and returns the expected directory entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.