Problem
resolvePythonCmd() (lines 22-33) may return non-existent python path, causing cryptic spawn() errors.
Recommended Solution
Validate Python exists before spawning:
function resolvePythonCmd() {
const venv = process.env.VIRTUAL_ENV;
let cmd;
if (venv) {
cmd = process.platform === 'win32'
? path.join(venv, 'Scripts', 'python.exe')
: path.join(venv, 'bin', 'python');
if (fs.existsSync(cmd)) return cmd;
}
cmd = process.platform === 'win32' ? 'python' : 'python3';
// Verify Python is available
const { execSync } = require('child_process');
try {
execSync(`${cmd} --version`);
return cmd;
} catch {
throw new Error(`Python interpreter not found. Tried: ${cmd}`);
}
}
Program Template
Suggested Labels
reliability, error-handling, python, gssoc-eligible
EOF
)
Problem
resolvePythonCmd() (lines 22-33) may return non-existent python path, causing cryptic spawn() errors.
Recommended Solution
Validate Python exists before spawning:
Program Template
Suggested Labels
reliability, error-handling, python, gssoc-eligible
EOF
)