[issue25655] Python errors related to failures loading DLL's lack information

Philippe Ombredanne report at bugs.python.org
Wed Sep 23 03:37:42 EDT 2020


Philippe Ombredanne <pombredanne at nexb.com> added the comment:

> I wouldn't refuse a docs PR to add a short section pointing to
> this page and explaining its relevance: 
> https://docs.microsoft.com/cpp/build/reference/dependents

Steve,
would you see this as a note in https://docs.python.org/3/library/ctypes.html?highlight=ctypes#loading-shared-libraries

What about something like this?

class ctypes.CDLL
.....

Note: On Windows a call to CDLL(name) may fail even if the DLL name exists when a dependent DLL of this DLL is found. This will lead to an OSErrror error with the message "[WinError 126] The specified module could not be found".

This error message does not contains the name of the missing DLL because the Windows API does not return this information making this error hard to diagnose.

To resolve this error and determine which DLL is missing, you need to find the list of dependent DLLs using Windows debugging and tracing tools.

See https://docs.microsoft.com/cpp/build/reference/dependents for some explanations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25655>
_______________________________________


More information about the Python-bugs-list mailing list