Richard Oudkerk added the comment: > But I observe that the same script(with proper modification of file names) > works very well under Linux. After I dive into the source code, I found > Python use execvpe to invoke the child process which _will_ use the PATH > variable to search the executable.
The posix execvpe function does not use PATH from the passed environment, but (surprisingly to me) os.execvpe does. subprocess in Python 3 no longer uses os.execvpe, but still goes out of its way to use envp['PATH'] on posix systems when searching for the executable. So I think you have a legitimate complaint of inconsistency. However, I don't think your suggested fix is a good idea since it (temporarily) changes the environment of the current process which might be problematic in a threaded program. I am sure that Python 2.7 will not be patched to address this, but you might want to make a feature request for Python 3.4. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15451> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com