Warn on unexpected ZIP compression methods (#17885)
## Summary This adds warnings to both our steam and sync ZIP handling on ZIP entries that aren't "well-known." For now, "well-known" means stored (i.e. no compression), DEFLATE, or zstd. In practice we have duplicated codepaths for this check: one for the "sync" (pre-downloaded) path, and one for the streaming path. See #16911 and #17467 for context. ## Test Plan Will update snapshots if/when they change. I'll also add a ZIP test for this. (Upd: added some "futzed" wheels for the ZIP tests.) --------- Signed-off-by: William Woodruff <william@astral.sh>
This commit is contained in:
@@ -1401,12 +1401,12 @@ impl ManagedPythonDownload {
|
||||
if let Some(reporter) = reporter {
|
||||
let progress_key = reporter.on_request_start(direction, &self.key, size);
|
||||
let mut reader = ProgressReader::new(&mut hasher, progress_key, reporter);
|
||||
uv_extract::stream::archive(&mut reader, ext, target)
|
||||
uv_extract::stream::archive(filename, &mut reader, ext, target)
|
||||
.await
|
||||
.map_err(|err| Error::ExtractError(filename.to_owned(), err))?;
|
||||
reporter.on_request_complete(direction, progress_key);
|
||||
} else {
|
||||
uv_extract::stream::archive(&mut hasher, ext, target)
|
||||
uv_extract::stream::archive(filename, &mut hasher, ext, target)
|
||||
.await
|
||||
.map_err(|err| Error::ExtractError(filename.to_owned(), err))?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user