This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author henry.precheur
Recipients alexis, eric.araujo, henry.precheur, tarek
Date 2011-06-27.15:17:57
SpamBayes Score 8.844106e-07
Marked as misclassified No
Message-id <20110627151756.GA20626@onion.novuscom.net>
In-reply-to <1309185189.13.0.716890472446.issue12420@psf.upfronthosting.co.za>
Content
I think that returning None would be a better option. The function
documentation says:

  Tries to find 'executable' in the directories listed in 'path'.

  A string listing directories separated by 'os.pathsep'; defaults to
  os.environ['PATH'].  Returns the complete filename or None if not found.

If os.environ['PATH'] is empty the function returns None:

  >>> from distutils.spawn import find_executable
  >>> find_executable('does not exist', path='/bin:/usr/bin') is None
  True
  >>> find_executable('test', path='') is None
  True

This would be consistent with the function definition. If PATH is
undefined, the executable cannot be found, therefor returning None seems
like the right thing to do.

On Mon, Jun 27, 2011 at 02:33:09PM +0000, ??ric Araujo wrote:
> 
> ??ric Araujo <merwok@netwok.org> added the comment:
> 
> Okay, I see the original use case (#12401).  I think the proper thing to do is to skip tests that rely on the environment being non-empty.
> 
> ----------
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue12420>
> _______________________________________
History
Date User Action Args
2011-06-27 15:17:58henry.precheursetrecipients: + henry.precheur, tarek, eric.araujo, alexis
2011-06-27 15:17:57henry.precheurlinkissue12420 messages
2011-06-27 15:17:57henry.precheurcreate