[New-bugs-announce] [issue39260] find_executable() Fails To Find Many Executables on Windows

Thomas Passin report at bugs.python.org
Wed Jan 8 10:53:12 EST 2020


New submission from Thomas Passin <pub1 at tompassin.net>:

On Windows, find_executable() in distutils.spawn may fail to find executables that it ought to.  This is because the PATH environmental variable no longer includes %ProgramFiles% and %ProgramFiles(x86)%.  At least, that is the case on my brand new Windows 10 Computer running Windows 10 Pro.  In the past, I'm fairly sure these directories were always included on the PATH.

Some programs add their install directory to the Windows PATH, but many don't.  For example, on my new computer, Pandoc added itself to the PATH but EditPlus and Notepad++ did not.  So

    >>> find_executable('pandoc')
    'C:\\Program Files\\Pandoc\\pandoc.exe'
but
    >>> find_executable('editplus')   # no result
    >>> find_executable('notepad++')  # no result

I suggest that in Windows, find_executable() should check for and add the %ProgramFiles% and %ProgramFiles(x86)% directories to the system PATH before executing its search.

----------
components: Distutils
messages: 359602
nosy: dstufft, eric.araujo, tbpassin
priority: normal
severity: normal
status: open
title: find_executable() Fails To Find Many Executables on Windows
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39260>
_______________________________________


More information about the New-bugs-announce mailing list