Author ned.deily
Recipients brian.curtin, hynek, ned.deily, pitrou, r.david.murray, serhiy.storchaka, tarek
Date 2013-02-18.08:06:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361174799.14.0.608178568402.issue17012@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-02-18 08:06:39ned.deilysetrecipients: + ned.deily, pitrou, tarek, r.david.murray, brian.curtin, hynek, serhiy.storchaka
2013-02-18 08:06:39ned.deilysetmessageid: <1361174799.14.0.608178568402.issue17012@psf.upfronthosting.co.za>
2013-02-18 08:06:39ned.deilylinkissue17012 messages
2013-02-18 08:06:38ned.deilycreate