Skip to content

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

Open
bIackr0se wants to merge 3 commits into
fsspec:masterfrom
bIackr0se:fix/github-file-listing
Open

bIackr0se wants to merge 3 commits into
fsspec:masterfrom
bIackr0se:fix/github-file-listing

Conversation

@bIackr0se

Copy link
Copy Markdown

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
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.

1 participant