[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 99db73ce8374 by Serhiy Storchaka in branch '3.3': Fix pathext test for shutil.which() which was http://hg.python.org/cpython/rev/99db73ce8374 New changeset ab0ff935126c by Serhiy Storchaka in branch 'default': Fix pathext test for shutil.which() whi

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed. Thank you for for the patch. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset f18d11ab53a0 by Serhiy Storchaka in branch '3.3': Issue #16957: shutil.which() no longer searches a bare file name in the http://hg.python.org/cpython/rev/f18d11ab53a0 New changeset 7b51568cfbae by Serhiy Storchaka in branch 'default': Issue #16957:

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have reorganized tests a little. -- assignee: -> serhiy.storchaka stage: patch review -> commit review versions: +Python 3.4 Added file: http://bugs.python.org/file28801/shutil_which_cwd4.patch ___ Python tracker

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yes, as far as I know, ./script works in the same way as dir/script - from the current directory, but not from $PATH. The first test added is for the case I reported - which('script') shouldn't look in the current directory on Unix. The second test would have

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps the comment in which() is misleading now, if I understand correctly the meaning of the words "short circuit". Native speakers, please correct me if I wrong. -- ___ Python tracker

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Éric Araujo
Éric Araujo added the comment: I assume that ./script is working just like dir/script (what the tests exercize is not crystal clear to me). -- ___ Python tracker ___ ___

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo stage: -> patch review versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-li

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: That makes sense - foo/setup.py can be run from the working directory, but you can't refer to subdirectories on $PATH like that. I've added a revised version of the patch. -- Added file: http://bugs.python.org/file28763/shutil_which_cwd2.patch ___

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, it should be if os.path.dirname(cmd): if _access_check(cmd, mode): return cmd return None -- ___ Python tracker _

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it should be if os.path.dirname(cmd) and _access_check(cmd, mode): -- nosy: +hynek, serhiy.storchaka, tarek ___ Python tracker __

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-17 Thread Thomas Kluyver
Thomas Kluyver added the comment: I've added a patch with my suggested fix, as well as a test for this. test_shutil all passes on Linux - I haven't run the tests on Windows. -- keywords: +patch Added file: http://bugs.python.org/file28761/shutil_which_cwd.patch

[issue16957] shutil.which() shouldn't look in working directory on unix-y systems

2013-01-13 Thread Thomas Kluyver
New submission from Thomas Kluyver: There's a 'short circuit' in shutil.which(), described as 'If we're given a full path which matches the mode and it exists, we're done here.' It also matches if an executable file of the same name is present in the working directory, although on most Unix-y