Message182303
The result of PATH= is also platform dependent. Testing on OS X which has a BSD heritage rather a Linux one:
$ PATH= /usr/bin/which python
./python
# without patch
$ PATH= ./python -c 'import shutil; print(shutil.which("python"))'
python
$ ./python -c 'import shutil; print(shutil.which("python", path=""))'
/usr/bin/python
# with the patch:
$ PATH= ./python -c 'import shutil; print(shutil.which("python"))'
None
$ ./python -c 'import shutil; print(shutil.which("python", path=""))'
None
So, for OS X, shutil.which doesn't match /usr/bin/which behavior for the PATH= case either with or without the patch. FreeBSD (8.2) /usr/bin/which is the same. The other cases are the same as Linux.
I suppose the patched behavior is preferable, though.
In any case, the shutil.which docs also need to be updated. |
|
Date |
User |
Action |
Args |
2013-02-18 08:06:39 | ned.deily | set | recipients:
+ ned.deily, pitrou, tarek, r.david.murray, brian.curtin, hynek, serhiy.storchaka |
2013-02-18 08:06:39 | ned.deily | set | messageid: <1361174799.14.0.608178568402.issue17012@psf.upfronthosting.co.za> |
2013-02-18 08:06:39 | ned.deily | link | issue17012 messages |
2013-02-18 08:06:38 | ned.deily | create | |
|