STINNER Victor <victor.stin...@haypocalc.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7774>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to