Download: never leave the target file behind after a failure - #103
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #103 +/- ##
==========================================
+ Coverage 86.30% 86.33% +0.02%
==========================================
Files 32 32
Lines 1906 1910 +4
==========================================
+ Hits 1645 1649 +4
Misses 261 261
🚀 New features to boost your workflow:
|
|
I do not understand the "One question". |
b7cd336 to
a6c57c3
Compare
|
Last week I was a conference and went a bit overboard with allowing my AI to open PRs without me double checking everything. That was a mistake and I apologize if I wasted anyone's time by having them stare at slop. (The "reviewed by me" was inserted by the AI without consulting with me -- but I should have caught it. Argh). Anyway: I've marked this PR as "draft" for now, please don't merge it -- I'll carefully review and edit it, and will mark it as "ready for review" once I am satisfied. Don't waste your time on it for now (that said, of course you are welcome to leave feedback, but don't feel obliged to). |
Clean up once in 'Download', after a method reports failure, rather than in each method: the guarantee then holds for methods added to 'Download_Methods' from outside too, and there is one place to look. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
a6c57c3 to
93a5ff5
Compare
With
opt.targetset and the download failing, the three methods disagree:via wgetremoves the partial file,via curlleaves it, andvia SingleHTTPRequestwrites the response body (a 404 error page) to the target and then reports failure. So whether the file exists afterwards, and what is in it, depends on which method was available.Fix this by uniformly deleting the
targetfile in case of a failure.Written with Claude Opus 5 via Claude Code.