diff --git a/src/module_writer.rs b/src/module_writer.rs index c48d05460..b6d9fce4d 100644 --- a/src/module_writer.rs +++ b/src/module_writer.rs @@ -1212,8 +1212,12 @@ pub fn write_python_part( continue; } } + #[cfg(unix)] + let mode = absolute.metadata()?.permissions().mode(); + #[cfg(not(unix))] + let mode = 0o644; writer - .add_file(relative, &absolute) + .add_file_with_permissions(relative, &absolute, mode) .context(format!("File to add file from {}", absolute.display()))?; } }