Repository navigation
CI: Fix the GitHub fallback of the download retries - #3499
Merged
Merged
Conversation
If a jsDelivr download that was passed as a `urllib.request.Request`, as by pandas and PEtab, failed, the GitHub fallback re-used a copy of that request. The failed attempt had added a `Host: cdn.jsdelivr.net` header to it, so raw.githubusercontent.com replied with 404 or 421. Create a new request with the original headers instead. Furthermore: * Retry dropped connections and timeouts while waiting for the response, which `urlopen` doesn't wrap in a `URLError`. * Only retry HTTP(S) downloads, not, e.g., missing local files. * Only fall back to GitHub for jsDelivr URLs with a branch or commit. Without a ref, or with a version (range), jsDelivr serves a release, whose GitHub ref may differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3499 +/- ##
=======================================
Coverage 80.23% 80.23%
=======================================
Files 331 331
Lines 23400 23400
Branches 1627 1627
=======================================
Hits 18774 18774
Misses 4620 4620
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
dweindl
marked this pull request as ready for review
October 28, 2026 22:10
dweindl
enabled auto-merge
October 28, 2026 22:11
FFroehlich
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the GitHub fallback from #3497 for downloads passed as
urllib.request.Request, as pandas and PEtab do. The fallback re-used a copy of the failed request, to which the failed attempt had added aHost: cdn.jsdelivr.netheader, so raw.githubusercontent.com replied with 404 (e.g., this notebook test in the merge queue). Now, a new request with the original headers is created.Furthermore, dropped connections and timeouts while waiting for the response, which
urlopendoesn't wrap in aURLError, are now retried; only HTTP(S) downloads are retried (not, e.g., missing local files); and only jsDelivr URLs with a branch or commit fall back to GitHub, since without a ref, or with a version (range), jsDelivr serves a release whose GitHub ref may differ.🤖 Generated with Claude Code