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

> Since I just dug enough to find it, the best way to diagnose problems 
> with dependent DLLs not being found is probably to run Process Monitor 
> [1] while doing the import and checking its logs. It should show the 
> paths that were attempted to be accessed.

Don't forget loader snaps, which we can log using a standard debugger such as 
WinDbg or by attaching a Python script as a debugger (e.g. debug a child 
process via the DEBUG_PROCESS creation flag). For the latter, we need a 
debug-event loop (i.e. WaitForDebugEventEx via ctypes) that logs debug-string 
events. This will show the paths that the loader checks and the load attempts 
that fail with STATUS_DLL_NOT_FOUND (0xC0000135). We have to first enable 
loader snaps for the executable by setting a flag value of 2 in the 
"GlobalFlag" DWORD in the key "HKLM\Software\Microsoft\Windows 
NT\CurrentVersion\Image File Execution Options\<executable name>". Or use 
gflags.exe to set this value.

----------

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

Reply via email to