diff Modules/getpath.c @ 59508:8b246e8560db legacy-trunk

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.
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 11 Mar 2010 12:34:39 +0000
parents d3a35fe13838
children fd25030223b0
line wrap: on
line diff
--- a/Modules/getpath.c	Thu Mar 11 01:50:48 2010 +0000
+++ b/Modules/getpath.c	Thu Mar 11 12:34:39 2010 +0000
@@ -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';