Revert "Sanitize whitespaces in python invocation"

This reverts commit c244f0797b.
pull/245/head
Piero Toffanin 2025-08-23 13:53:49 -04:00
rodzic c244f0797b
commit 199904679b
1 zmienionych plików z 6 dodań i 9 usunięć

Wyświetl plik

@ -122,16 +122,13 @@ module.exports = {
return; // Skip rest
}
const getOdmOptions = (pythonExe, useShell, done) => {
const getOdmOptions = (pythonExe, done) => {
// Launch
const env = utils.clone(process.env);
env.ODM_OPTIONS_TMP_FILE = utils.tmpPath(".json");
env.ODM_PATH = config.odm_path;
const helper = path.join(__dirname, "..", "helpers", "odmOptionsToJson.py");
const helperSanitized = useShell ? `"${helper}"` : helper;
const odmSanitized = useShell ? `"${config.odm_path}"` : config.odm_path;
let childProcess = spawn(pythonExe, [helperSanitized,
"--project-path", odmSanitized, "bogusname"], { env, stdio: 'inherit', shell: useShell });
let childProcess = spawn(pythonExe, [path.join(__dirname, "..", "helpers", "odmOptionsToJson.py"),
"--project-path", config.odm_path, "bogusname"], { env, stdio: 'inherit', shell: true });
// Cleanup on done
let handleResult = (err, result) => {
@ -163,11 +160,11 @@ module.exports = {
}
if (os.platform() === "win32"){
getOdmOptions("helpers\\odm_python.bat", true, done);
getOdmOptions("helpers\\odm_python.bat", done);
}else{
// Try Python3 first
getOdmOptions("python3", false, (err, result) => {
if (err) getOdmOptions("python", false, done);
getOdmOptions("python3", (err, result) => {
if (err) getOdmOptions("python", done);
else done(null, result);
});
}