Description: Use zip 9
Origin: backport, https://github.com/astral-sh/ruff/commit/fde7c6debc8ab1507d1e2bd74e5d8d8c394acef1
Bug-Debian: https://bugs.debian.org/1153052
Forwarded: not-needed
---
Index: ruff/Cargo.toml
===================================================================
--- ruff.orig/Cargo.toml
+++ ruff/Cargo.toml
@@ -253,7 +253,7 @@ wasm-bindgen = { version = "0.2.92", default-features = false, features = ["std"
 wasm-bindgen-test = { version = "0.3.42", default-features = false, features = ["std"] }
 which = { version = "8.0.0", default-features = false, features = ["real-sys"] }
 wild = { version = "2", default-features = false }
-zip = { version = "8.0", default-features = false }
+zip = { version = "9.0.5", default-features = false, features = ["deflate-flate2-zlib-rs"] } # spellchecker:disable-line

 [workspace.metadata.cargo-shear]
 ignored = [
Index: ruff/crates/ruff_db/src/vendored.rs
===================================================================
--- ruff.orig/crates/ruff_db/src/vendored.rs
+++ ruff/crates/ruff_db/src/vendored.rs
@@ -141,6 +141,7 @@ impl VendoredFileSystem {
             .into_owned();

         self.inner.0.file_names().filter_map(move |name| {
+            let name = name.expect("vendored paths are valid UTF-8");
             // Any entry that doesn't have the `path` (with a
             // trailing slash) as a prefix cannot possibly be in
             // the directory referenced by `path`.
@@ -168,7 +169,7 @@ impl VendoredFileSystem {
             }

             Some(DirectoryEntry {
-                path: VendoredPathBuf::from(name),
+                path: VendoredPathBuf::from(name.as_ref()),
                 file_type,
             })
         })
@@ -192,7 +193,11 @@ impl fmt::Debug for VendoredFileSystem {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if f.alternate() {
             let mut archive = self.archive_reader();
-            let mut paths: Vec<String> = archive.0.file_names().map(String::from).collect();
+            let mut paths: Vec<String> = archive
+                .0
+                .file_names()
+                .map(|name| name.expect("vendored paths are valid UTF-8").into_owned())
+                .collect();
             paths.sort();
             let debug_info: BTreeMap<String, ZipFileDebugInfo> = paths
                 .iter()
