Skip to content

Navigation Menu

Sign up

ngclient: Normalize streaming download errors - #3063

Open
FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/streaming-download-errors
Open

FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/streaming-download-errors

Conversation

@FayezBast

@FayezBast FayezBast commented Nov 26, 2026

Copy link
Copy Markdown

FetcherInterface.fetch() wraps errors when it creates the byte iterator. Errors raised while consuming that iterator can escape as raw exceptions, bypassing callers that catch DownloadError.

This PR wraps unexpected streaming errors in DownloadError and preserves the original exception as the cause. It also closes unread or incomplete urllib3 responses before returning their connections to the pool, including when a caller closes the iterator before the first read or when decoding fails.

Testing

All 216 unit tests passed. Fetcher tests passed with urllib3 2.0.7 and 2.8.0. Ruff, mypy, and Sphinx also passed.

Related to #2896, which covers retries for streaming failures.

Wrap streaming failures in DownloadError and close unread or incomplete urllib3 responses before returning their connections to the pool.
Signed-off-by: FayezBast <fayezbast15@gmail.com>
FayezBast requested a review from a team as a code owner November 26, 2026 00:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /