Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Open
Labels
Description
I would like to search for an executable in the PATH but not from the current working directory (cwd). By default, as documented inshutil.which, it prepends the cwd before PATH, so it's not possible to get the expected executable.
For example, I have awhoami.exe in the cwd but I would like to get the one from the system32 directory; there's no way to do so usingshutil.which.
>>>importshutil>>>shutil.which('whoami')'.\\whoami.EXE'
I think it makes sense for that to be the default behaviour since that's how it is on Windows. I would like to have a parameter to disable this behaviour inshutil.which.
Thanks!