https://github.com/python/cpython/commit/5876063d06ec55b10793f34bfe516c10f608665c
commit: 5876063d06ec55b10793f34bfe516c10f608665c
branch: main
author: Hood Chatham <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2024-12-09T10:01:37+08:00
summary:
gh-127503 Don't propagate native PATH to Emscripten Python (#127633)
Modifies the handling of PATH to ensure that native executables aren't picked
up when running under node.
files:
M Tools/wasm/emscripten/node_entry.mjs
diff --git a/Tools/wasm/emscripten/node_entry.mjs
b/Tools/wasm/emscripten/node_entry.mjs
index 40ab1515cf28c1..98b8f572a7e762 100644
--- a/Tools/wasm/emscripten/node_entry.mjs
+++ b/Tools/wasm/emscripten/node_entry.mjs
@@ -35,11 +35,12 @@ const settings = {
mountDirectories(Module);
Module.FS.chdir(process.cwd());
Object.assign(Module.ENV, process.env);
+ delete Module.ENV.PATH;
},
// Ensure that sys.executable, sys._base_executable, etc point to python.sh
// not to this file. To properly handle symlinks, python.sh needs to compute
// its own path.
- thisProgram: process.argv[thisProgramIndex],
+ thisProgram: process.argv[thisProgramIndex].slice(thisProgram.length),
// After python.sh come the arguments thatthe user passed to python.sh.
arguments: process.argv.slice(thisProgramIndex + 1),
};
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]