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

> On Win7, running Python in the terminal will attempt to load the 
> "api-ms-win-core-path-l1-1-0.dll" from various paths outside of the 
> Python directory and the C:\Windows\System32 directories.

"api-ms-win-core-path-l1-1-0.dll" is not assigned in the API set schema (in 
ApiSetSchema.dll) in Windows 7. Since the name is neither in the list of known 
DLLs nor the list of assigned API sets, the loader searches for it in the 
normal way. (FYI, the number of API sets increased from 35 in Windows 7 up to 
502 in Windows 8.1.)

> I'm working on a fix to pass the LOAD_LIBRARY_SEARCH_DEFAULT_DIRS

I think this could use just LOAD_LIBRARY_SEARCH_SYSTEM32. I see no reason to 
try to load "api-ms-win-core-path-l1-1-0.dll" from the application directory or 
user directories.

I'm adding 3.6-3.9 to the list of affected versions. In 3.9 it can use a static 
import instead (i.e. remove LoadLibraryaExW / GetProcAddress), since only 
Windows 8.1+ is supported.

----------
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
stage:  -> needs patch
type:  -> security
versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9

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

Reply via email to