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

> the way `python -m pip` searches for the module to execute is much 
> closer to the way Windows searches for a command like `pip` (i.e. 
> current directory first)

That's classic Windows behavior. However, search paths for CreateProcess and 
the loader are composed on demand, which allows different behavior to be 
selected easily enough. The current behavior depends on a mix of environment 
variables, registry settings, reserved names (known DLLs, API sets), 
application and DLL manifests, .local redirection, and in-process 
configuration. For example, to skip the working directory when searching for 
DLLs, there's the CWDIllegalInDllSearch registry setting, 
SetDllDirectoryW(L""), or SetDefaultDllDirectories (the latter removes PATH as 
well, so it's not suited for loosely-couple systems). To skip  the working 
directory when searching for executables, define the environment variable 
"NoDefaultCurrentDirectoryInExePath".

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

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

Reply via email to