Close incomplete downloads before removing them #14237
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.33) × (1 − Review Confidence (0.89)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 91 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.271
Real PR Conversation Timeline
3 items
Approved
Not a fan of the Claude-ism in the code comments here, but LGTM.
Not a fan of the Claude-ism in the code comments here, but LGTM.
Yeah... cleaned comments
ichard26
notatallshaw
What does this PR do?
Delete an incomplete download only after closing it. Builtin
open()does not share delete access on Windows, soos.removeon the still-open file fails withPermissionError(documented), masking the incomplete-download error and leaving the partial file behind. The partial file is now also removed when a server answers a resume request from the wrong offset, which used to leave it on disk on every platform.PR Checklist:
<!--- Go over all the following points, and put an
xin all the boxes that apply. -->This bug was found with a sweep of pip's codebase using codex - gpt 5.6 sol ultra.