Skip to content

Read empty GitHub files without the HTTP extra - #2223

Open
hoobnn wants to merge 1 commit into
fsspec:masterfrom
hoobnn:fix/github-empty-files
Open

hoobnn wants to merge 1 commit into
fsspec:masterfrom
hoobnn:fix/github-empty-files

Conversation

@hoobnn

@hoobnn hoobnn commented Oct 3, 2026

Copy link
Copy Markdown

Summary

Reading a zero-byte file with only fsspec[github] installed currently raises an ImportError asking for fsspec[http]. GitHub returns these files as encoding="base64" with an empty content string, which was being mistaken for content that needs a separate download.

Use the response encoding to recognize inline content, including empty files. Large files with encoding="none" and Git LFS pointers still use the HTTP download path.

Tests

  • The new empty-file regression fails before the fix.
  • test_github_paths.py and test_memory.py pass (85 tests); the new tests mock requests and need no network.
  • A request for this repository's empty fsspec/implementations/__init__.py returns encoding="base64" with empty content. The live large-file and LFS tests in test_github.py also pass.

I used OpenAI Codex and Claude Code to investigate the issue, write the fix and tests, and run the checks. I reviewed the code and this description myself.

Assisted by Claude Code

Co-authored-by: Codex <codex@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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