diff --git a/src/util.rs b/src/util.rs index 5fedcb1..acfc3e7 100644 --- a/src/util.rs +++ b/src/util.rs @@ -405,25 +405,27 @@ pub fn extract_zip(file: &fs::File, out_path: &Path, rename: &Option<(String, St let mut file = archive.by_index(i).unwrap(); // Change name here instead of after in case we've already installed a non-renamed version. // (which would be overwritten by this one.) - let file_str2 = file.sanitized_name(); + let file_str2 = file.enclosed_name().unwrap(); let file_str = file_str2.to_str().expect("Problem converting path to str"); let extracted_file = if !file_str.contains("dist-info") && !file_str.contains("egg-info") { match rename { - Some((old, new)) => file - .sanitized_name() - .to_str() - .unwrap() - .to_owned() - .replace(old, new) - .into(), - None => file.sanitized_name(), + Some((old, new)) => PathBuf::from_str( + file.enclosed_name() + .unwrap() + .to_str() + .unwrap() + .to_owned() + .replace(old, new) + .as_str(), + ), + None => PathBuf::from_str(file.enclosed_name().unwrap().to_str().unwrap()), } } else { - file.sanitized_name() + PathBuf::from_str(file.enclosed_name().unwrap().to_str().unwrap()) }; - let outpath = out_path.join(extracted_file); + let outpath = out_path.join(extracted_file.unwrap()); if (&*file.name()).ends_with('/') { fs::create_dir_all(&outpath).unwrap();