Eryk Sun <eryk...@gmail.com> added the comment:

> In that the best tactic would be to look in those top-level 
> directories for a directory with the same name as the executable.

It may be a common pattern, but such a guess is not reliable. The needed 
executable may be in an unrelated directory at an arbitrary depth in the tree. 

There are reliable ways to find an executable in Windows other than searching 
PATH -- assuming the application wants to be found in a reliable way. For 
example, we can use winreg to search the subkey names of 
"[HKCU|HKLM]\Software\Microsoft\Windows\CurrentVersion\App Paths" for the given 
executable name (e.g. "notepad++.exe"). The default value of each subkey is the 
fully-qualified path of the executable.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39260>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to