Skip to content

Return a list when listing a single GitHub file - #2225

Merged
martindurant merged 4 commits into
fsspec:masterfrom
bIackr0se:fix/github-file-listing
Oct 8, 2026
Merged

martindurant merged 4 commits into
fsspec:masterfrom
bIackr0se:fix/github-file-listing

Conversation

@bIackr0se

Copy link
Copy Markdown
Contributor

Listing a single file with GithubFileSystem.ls() returns a string instead of a list. Code that iterates the result sees individual characters rather than a filename. Return a one-element list using the resolved file entry, consistent with detailed listings.

fs.ls("README.md")
# before: "README.md"
# after:  ["README.md"]

Verification:

  • Four non-detailed listing regressions fail before the fix and pass after it; detailed listings, directory listings and missing-file errors remain covered.
  • GitHub listing/path tests and the filesystem specification suite: 241 passed.
  • Installed wheel against the public GitHub API at 778f956: root and nested file listings, protocol-prefixed inputs, listing-to-read iteration, directory listings and missing-file handling pass.
  • Pre-commit checks pass.

@bIackr0se
bIackr0se marked this pull request as ready for review October 7, 2026 22:47
@martindurant
martindurant merged commit 26ebc63 into fsspec:master Oct 8, 2026
21 of 22 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.

2 participants