Skip to content

fix: use binary-mode subprocess for GitHub release asset downloads#6

Merged
abrichr merged 1 commit intomainfrom
fix/tidy-asset-download-auth
Mar 21, 2026
Merged

fix: use binary-mode subprocess for GitHub release asset downloads#6
abrichr merged 1 commit intomainfrom
fix/tidy-asset-download-auth

Conversation

@abrichr
Copy link
Copy Markdown
Member

@abrichr abrichr commented Mar 21, 2026

Fix release asset scanner: text=True corrupted binary data, gh release download had no tag, --output is not a valid gh api flag. Now uses subprocess.run with text=False and Accept: application/octet-stream.

The release asset scanner was failing to download all assets because:
1. _download_asset used _gh_api() which runs with text=True,
   corrupting binary asset content
2. _download_asset_binary first tried gh release download --pattern *
   without specifying a release tag (defaulted to latest instead of
   the target release)
3. The fallback used --output which is not a valid gh api flag
4. Even the fallback used run_cmd() with text=True

Replace both methods with a single _download_asset_binary that calls
gh api with Accept: application/octet-stream in binary mode
(text=False) and writes raw bytes to disk. gh api handles auth
and redirect-following automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@abrichr abrichr merged commit 7399c7e into main Mar 21, 2026
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