Author vstinner
Recipients ezio.melotti, flox, jnoller, pitrou, schmir, tarek, vstinner
Date 2010-03-11.02:01:42
SpamBayes Score 2.95861e-10
Marked as misclassified No
Message-id <>
This issue is not related to subprocess, subprocess is just used in examples to show the bug. The problem is that Python defines an invalid sys.executable if the process was created with a custom argv[0]. In Python trunk, the site module now uses sysconfig which depends on sys.executable. If sys.executable, sysconfig fails, site import fails, and finally Python exists (since my fix for #3137). I think that we have to split the problem in two parts:

 1) Python startup fails if sysconfig raises an error
 2) sys.executable is invalid is argv[0] is modified

(1) Functions using (indirectly) sysconfig in site module:

 - addbuilddir()
 - addusersitepackages()

I don't know if Python should exits with an error if these functions fail.

(2) Except of Python unit test, is it required in "real world" applications? I know that Twisted does modify argv[0] to display "twistd" in process list. It looks like there is trivial, portable and/or reliable solution for this problem.
Date User Action Args
2010-03-11 02:01:45vstinnersetrecipients: + vstinner, pitrou, schmir, tarek, jnoller, ezio.melotti, flox
2010-03-11 02:01:44vstinnersetmessageid: <>
2010-03-11 02:01:43vstinnerlinkissue7774 messages
2010-03-11 02:01:42vstinnercreate