Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.9] bpo-25655: Improve Win DLL loading failures doc (GH-22372) #22894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-25655: Improve Win DLL loading failures doc (GH-22372)
Add documentation to help diagnose CDLL dependent DLL loading errors
on windows for OSError with message:
"[WinError 126] The specified module could not be found"
This error is otherwise difficult to diagnose.
(cherry picked from commit b6f2fc9)

Co-authored-by: Philippe Ombredanne <pombredanne@gmail.com>
  • Loading branch information
pombredanne authored and miss-islington committed Oct 22, 2020
commit a980cc0e5730d6ca704e5df4ae257b00e70f8169
15 changes: 15 additions & 0 deletions 15 Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,21 @@ way is to instantiate one of the following classes:
libraries use the standard C calling convention, and are assumed to return
:c:type:`int`.

On Windows creating a :class:`CDLL` instance may fail even if the DLL name
exists. When a dependent DLL of the loaded DLL is not found, a
:exc:`OSError` error is raised with the message *"[WinError 126] The
specified module could not be found".* This error message does not contain
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 not found, you need to find the list of dependent
DLLs and determine which one is not found using Windows debugging and
tracing tools.

.. seealso::

`Microsoft DUMPBIN tool <https://docs.microsoft.com/cpp/build/reference/dependents>`_
-- A tool to find DLL dependents.


.. class:: OleDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.