mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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.
This commit is contained in:
parent
637637021a
commit
4a7e0c858c
4 changed files with 22 additions and 2 deletions
|
@ -441,7 +441,7 @@ calculate_path(void)
|
|||
}
|
||||
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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue