[issue444582] Finding programs in PATH, adding shutil.which

Antoine Pitrou report at bugs.python.org
Fri Jun 22 23:14:25 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> I think it would be more surprising if by default it did something
> different than what the 'which' command does.

You know, I've never noticed that Unix `which` automatically
abspathified the results (does it always? is it system-dependent? how
about Windows?).

> It also seems like the If there's demand for a non-abspath version we
> could add that as a feature later.

That sounds overkill. If which() calls abspath, then there's no way to
get a non-absolute result. While if which() doesn't call abspath, the
caller is free to call abspath() if they want to ensure the result is
absolute.

Sounds like a no-brainer to me :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue444582>
_______________________________________


More information about the Python-bugs-list mailing list