Message166761
| Author |
sbt |
| Recipients |
Grissiom.Gu, cvrebert, sbt, terry.reedy |
| Date |
2012年07月29日.14:04:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1343570694.9.0.95115813902.issue15451@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年07月29日 14:04:54 | sbt | set | recipients:
+ sbt, terry.reedy, cvrebert, Grissiom.Gu |
| 2012年07月29日 14:04:54 | sbt | set | messageid: <1343570694.9.0.95115813902.issue15451@psf.upfronthosting.co.za> |
| 2012年07月29日 14:04:54 | sbt | link | issue15451 messages |
| 2012年07月29日 14:04:54 | sbt | create |
|