Issue #7774: Set sys.executable to an empty string if argv[0] has been
set to an non existent program name and Python is unable to retrieve the real
program name.
Fix also sysconfig: if sys.executable is an empty string, use the current
working directory.
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 09fbe10..682ad3e 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -441,7 +441,7 @@
}
else
progpath[0] = '\0';
- if (progpath[0] != SEP)
+ if (progpath[0] != SEP && progpath[0] != '\0')
absolutize(progpath);
strncpy(argv0_path, progpath, MAXPATHLEN);
argv0_path[MAXPATHLEN] = '\0';