You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to search for an executable in the PATH but not from the current working directory (cwd). By default, as documented in shutil.which, it prepends the cwd before PATH, so it's not possible to get the expected executable.
For example, I have a whoami.exe in the cwd but I would like to get the one from the system32 directory; there's no way to do so using shutil.which.
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 in shutil.which.