Skip to content

fix(fetch-content): check the compressed stream's integrity on Windows - #1074

Open
jcristau wants to merge 1 commit into
taskcluster:mainfrom
jcristau:fetch-content-windows-gzip-crc
Open

jcristau wants to merge 1 commit into
taskcluster:mainfrom
jcristau:fetch-content-windows-gzip-crc

Conversation

@jcristau

@jcristau jcristau commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

When extracting with tarfile, reading stops at the end-of-archive marker, which can leave the end of the compressed stream unread. For gzip, that means its CRC never gets checked, so a corrupted archive whose deflate data still decodes would extract without error. Read the decompressed stream to the end after extracting, like the tar pipe already does.

This made test_stream_extract_broken_archive_not_retried[gz] fail intermittently on Windows.

When extracting with tarfile, reading stops at the end-of-archive marker,
which can leave the end of the compressed stream unread. For gzip, that
means its CRC never gets checked, so a corrupted archive whose deflate
data still decodes would extract without error. Read the decompressed
stream to the end after extracting, like the tar pipe already does.

This made test_stream_extract_broken_archive_not_retried[gz] fail
intermittently on Windows.
@jcristau
jcristau marked this pull request as ready for review October 8, 2026 14:15
@jcristau
jcristau requested a review from a team as a code owner October 8, 2026 14:15
@jcristau
jcristau requested a review from hneiva October 8, 2026 14:15

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant